Migration: Change field type bigint by int and disk_quota in MB - refs CT#5033

pull/5060/head
christian 2 years ago
parent 7f557fa64b
commit 1c315ed2ee
  1. 3
      public/main/admin/course_add.php
  2. 4
      public/main/admin/course_edit.php
  3. 2
      public/main/inc/lib/document.lib.php
  4. 2
      src/CoreBundle/Entity/AgendaEventInvitation.php
  5. 2
      src/CoreBundle/Entity/AgendaEventInvitee.php
  6. 2
      src/CoreBundle/Entity/AgendaReminder.php
  7. 2
      src/CoreBundle/Entity/BranchSync.php
  8. 4
      src/CoreBundle/Entity/BranchTransaction.php
  9. 2
      src/CoreBundle/Entity/Course.php
  10. 2
      src/CoreBundle/Entity/GradebookCertificate.php
  11. 2
      src/CoreBundle/Entity/GradebookComment.php
  12. 2
      src/CoreBundle/Entity/Message.php
  13. 2
      src/CoreBundle/Entity/MessageFeedback.php
  14. 2
      src/CoreBundle/Entity/MessageRelUser.php
  15. 2
      src/CoreBundle/Entity/MessageTag.php
  16. 2
      src/CoreBundle/Entity/Notification.php
  17. 2
      src/CoreBundle/Entity/Page.php
  18. 2
      src/CoreBundle/Entity/PageCategory.php
  19. 2
      src/CoreBundle/Entity/Resource/ResourceTag.php
  20. 2
      src/CoreBundle/Entity/Resource/ResourceUserTag.php
  21. 2
      src/CoreBundle/Entity/ResourceComment.php
  22. 2
      src/CoreBundle/Entity/ResourceFile.php
  23. 2
      src/CoreBundle/Entity/ResourceLink.php
  24. 2
      src/CoreBundle/Entity/ResourceNode.php
  25. 2
      src/CoreBundle/Entity/ResourceRight.php
  26. 2
      src/CoreBundle/Entity/SocialPost.php
  27. 2
      src/CoreBundle/Entity/SocialPostFeedback.php
  28. 2
      src/CoreBundle/Entity/TrackELastaccess.php
  29. 2
      src/CoreBundle/Entity/UserRelUser.php
  30. 2
      src/CoreBundle/Migrations/Schema/V200/Version20.php
  31. 20
      src/CoreBundle/Migrations/Schema/V200/Version20170525122900.php
  32. 6
      src/CoreBundle/Migrations/Schema/V200/Version20170625122900.php
  33. 2
      src/CoreBundle/Migrations/Schema/V200/Version20170625123000.php
  34. 12
      src/CoreBundle/Migrations/Schema/V200/Version20170625143000.php
  35. 8
      src/CoreBundle/Migrations/Schema/V200/Version20170625144000.php
  36. 4
      src/CoreBundle/Migrations/Schema/V200/Version20170625145000.php
  37. 10
      src/CoreBundle/Migrations/Schema/V200/Version20170625153000.php
  38. 4
      src/CoreBundle/Migrations/Schema/V200/Version20170625154000.php
  39. 2
      src/CoreBundle/Migrations/Schema/V200/Version20170626122900.php
  40. 2
      src/CoreBundle/Migrations/Schema/V200/Version20170628122900.php
  41. 14
      src/CoreBundle/Migrations/Schema/V200/Version20170904145500.php
  42. 4
      src/CoreBundle/Migrations/Schema/V200/Version20170904173000.php
  43. 2
      src/CoreBundle/Migrations/Schema/V200/Version20180319145700.php
  44. 2
      src/CoreBundle/Migrations/Schema/V200/Version20180928172830.php
  45. 2
      src/CoreBundle/Migrations/Schema/V200/Version20181025064351.php
  46. 4
      src/CoreBundle/Migrations/Schema/V200/Version20190110182615.php
  47. 4
      src/CoreBundle/Migrations/Schema/V200/Version20190110182620.php
  48. 4
      src/CoreBundle/Migrations/Schema/V200/Version20191101132000.php
  49. 22
      src/CoreBundle/Migrations/Schema/V200/Version20200821224242.php
  50. 2
      src/CoreBundle/Migrations/Schema/V200/Version20211005153900.php
  51. 4
      src/CoreBundle/Migrations/Schema/V200/Version20211026140820.php
  52. 4
      src/CoreBundle/Migrations/Schema/V200/Version20230216122950.php
  53. 2
      src/CoreBundle/Migrations/Schema/V200/Version20230720222130.php
  54. 45
      src/CoreBundle/Migrations/Schema/V200/Version20240112103400.php
  55. 396
      src/CoreBundle/Migrations/Schema/V200/Version20240112131200.php
  56. 2
      src/CourseBundle/Entity/CExerciseCategory.php
  57. 2
      src/CourseBundle/Entity/CLpIvInteraction.php
  58. 2
      src/CourseBundle/Entity/CLpIvObjective.php
  59. 2
      src/CourseBundle/Entity/CQuizRelQuestionCategory.php

@ -164,7 +164,7 @@ $form->addButtonCreate(get_lang('Create a course'));
// Set some default values.
$values['course_language'] = api_get_setting('platformLanguage');
$values['disk_quota'] = round(api_get_setting('default_document_quotum') / 1024 / 1024, 1);
$values['disk_quota'] = round(api_get_setting('default_document_quotum'), 1);
$default_course_visibility = api_get_setting('courses_default_creation_visibility');
@ -184,7 +184,6 @@ if ($form->validate()) {
$course = $form->exportValues();
$course_teachers = isset($course['course_teachers']) ? $course['course_teachers'] : null;
$course['disk_quota'] = $course['disk_quota'] * 1024 * 1024;
$course['exemplary_content'] = empty($course['exemplary_content']) ? false : true;
$course['teachers'] = $course_teachers;
$course['wanted_code'] = $course['visual_code'];

@ -285,7 +285,7 @@ $(function() {
$form->addButtonUpdate(get_lang('Edit course information'));
// Set some default values
$courseInfo['disk_quota'] = round(DocumentManager::get_course_quota($courseInfo['code']) / 1024 / 1024, 1);
$courseInfo['disk_quota'] = round(DocumentManager::get_course_quota($courseInfo['code']), 1);
$courseInfo['real_code'] = $courseInfo['code'];
$courseInfo['add_teachers_to_sessions_courses'] = $courseInfo['add_teachers_to_sessions_courses'] ?? 0;
@ -357,7 +357,7 @@ if ($form->validate()) {
->setVisualCode($visual_code)
->setDepartmentName($course['department_name'])
->setDepartmentUrl($department_url)
->setDiskQuota($course['disk_quota'] * 1024 * 1024)
->setDiskQuota($course['disk_quota'])
->setSubscribe($course['subscribe'])
->setUnsubscribe($course['unsubscribe'])
->setVisibility($visibility)

@ -23,7 +23,7 @@ class DocumentManager
/**
* @param string $course_code
*
* @return int the document folder quota for the current course in bytes
* @return int the document folder quota for the current course in megabytes
* or the default quota
*/
public static function get_course_quota($course_code = null)

@ -24,7 +24,7 @@ class AgendaEventInvitation
use TimestampableTypedEntity;
#[ORM\Id]
#[ORM\Column(type: 'bigint')]
#[ORM\Column(type: 'integer')]
#[ORM\GeneratedValue(strategy: 'AUTO')]
protected ?int $id = null;

@ -22,7 +22,7 @@ class AgendaEventInvitee
use TimestampableTypedEntity;
#[ORM\Id]
#[ORM\Column(type: 'bigint')]
#[ORM\Column(type: 'integer')]
#[ORM\GeneratedValue]
private int $id;

@ -17,7 +17,7 @@ class AgendaReminder
use TimestampableTypedEntity;
#[ORM\Id]
#[ORM\Column(type: 'bigint')]
#[ORM\Column(type: 'integer')]
#[ORM\GeneratedValue(strategy: 'AUTO')]
protected ?int $id = null;

@ -66,7 +66,7 @@ class BranchSync
#[ORM\Column(name: 'admin_phone', type: 'string', length: 250, nullable: true, unique: false)]
protected ?string $adminPhone = null;
#[ORM\Column(name: 'last_sync_trans_id', type: 'bigint', nullable: true, unique: false)]
#[ORM\Column(name: 'last_sync_trans_id', type: 'integer', nullable: true, unique: false)]
protected ?int $lastSyncTransId = null;
#[ORM\Column(name: 'last_sync_trans_date', type: 'datetime', nullable: true, unique: false)]

@ -16,7 +16,7 @@ use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity]
class BranchTransaction
{
#[ORM\Column(name: 'id', type: 'bigint', nullable: false)]
#[ORM\Column(name: 'id', type: 'integer', nullable: false)]
#[ORM\Id]
#[ORM\GeneratedValue]
protected ?int $id = null;
@ -25,7 +25,7 @@ class BranchTransaction
#[ORM\JoinColumn(name: 'status_id', referencedColumnName: 'id')]
protected Room $branchTransactionStatus;
#[ORM\Column(name: 'transaction_id', type: 'bigint')]
#[ORM\Column(name: 'transaction_id', type: 'integer')]
protected int $externalTransactionId;
#[ORM\Column(name: 'action', type: 'string', length: 20, nullable: true, unique: false)]

@ -291,7 +291,7 @@ class Course extends AbstractResource implements ResourceInterface, ResourceWith
#[ORM\Column(name: 'sticky', type: 'boolean')]
protected bool $sticky;
#[ORM\Column(name: 'disk_quota', type: 'bigint', unique: false, nullable: true)]
#[ORM\Column(name: 'disk_quota', type: 'integer', unique: false, nullable: true)]
protected ?int $diskQuota = null;
#[ORM\Column(name: 'last_visit', type: 'datetime', unique: false, nullable: true)]

@ -18,7 +18,7 @@ class GradebookCertificate
{
use UserTrait;
#[ORM\Column(name: 'id', type: 'bigint')]
#[ORM\Column(name: 'id', type: 'integer')]
#[ORM\Id]
#[ORM\GeneratedValue]
protected ?int $id = null;

@ -17,7 +17,7 @@ class GradebookComment
use TimestampableEntity;
use UserTrait;
#[ORM\Column(name: 'id', type: 'bigint')]
#[ORM\Column(name: 'id', type: 'integer')]
#[ORM\Id]
#[ORM\GeneratedValue]
protected ?int $id = null;

@ -78,7 +78,7 @@ class Message
public const MESSAGE_STATUS_INVITATION_ACCEPTED = 6;
public const MESSAGE_STATUS_INVITATION_DENIED = 7;
#[ORM\Column(name: 'id', type: 'bigint')]
#[ORM\Column(name: 'id', type: 'integer')]
#[ORM\Id]
#[ORM\GeneratedValue]
#[Groups(['message:read'])]

@ -18,7 +18,7 @@ use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity]
class MessageFeedback
{
#[ORM\Column(name: 'id', type: 'bigint')]
#[ORM\Column(name: 'id', type: 'integer')]
#[ORM\Id()]
#[ORM\GeneratedValue()]
private int $id;

@ -40,7 +40,7 @@ class MessageRelUser
public const TYPE_TO = 1;
public const TYPE_CC = 2;
#[ORM\Column(name: 'id', type: 'bigint')]
#[ORM\Column(name: 'id', type: 'integer')]
#[ORM\Id]
#[ORM\GeneratedValue]
protected ?int $id = null;

@ -57,7 +57,7 @@ class MessageTag
use TimestampableTypedEntity;
#[Groups(['message_tag:read', 'message:read'])]
#[ORM\Column(name: 'id', type: 'bigint')]
#[ORM\Column(name: 'id', type: 'integer')]
#[ORM\Id]
#[ORM\GeneratedValue]
protected ?int $id = null;

@ -16,7 +16,7 @@ use Gedmo\Mapping\Annotation as Gedmo;
#[ORM\Entity]
class Notification
{
#[ORM\Column(name: 'id', type: 'bigint')]
#[ORM\Column(name: 'id', type: 'integer')]
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'IDENTITY')]
protected ?int $id = null;

@ -53,7 +53,7 @@ use Symfony\Component\Validator\Constraints as Assert;
class Page
{
use TimestampableTypedEntity;
#[ORM\Column(name: 'id', type: 'bigint')]
#[ORM\Column(name: 'id', type: 'integer')]
#[ORM\Id]
#[ORM\GeneratedValue]
protected ?int $id = null;

@ -40,7 +40,7 @@ class PageCategory
{
use TimestampableTypedEntity;
#[Groups(['page_category:read', 'page_category:write'])]
#[ORM\Column(name: 'id', type: 'bigint')]
#[ORM\Column(name: 'id', type: 'integer')]
#[ORM\Id]
#[ORM\GeneratedValue]
protected ?int $id = null;

@ -17,7 +17,7 @@ class ResourceTag
use TimestampableEntity;
#[ORM\Id]
#[ORM\Column(type: 'bigint')]
#[ORM\Column(type: 'integer')]
#[ORM\GeneratedValue(strategy: 'AUTO')]
protected ?int $id = null;

@ -17,7 +17,7 @@ class ResourceUserTag
use TimestampableEntity;
#[ORM\Id]
#[ORM\Column(type: 'bigint')]
#[ORM\Column(type: 'integer')]
#[ORM\GeneratedValue(strategy: 'AUTO')]
protected ?int $id = null;

@ -35,7 +35,7 @@ class ResourceComment
use TimestampableTypedEntity;
#[ORM\Id]
#[ORM\Column(type: 'bigint')]
#[ORM\Column(type: 'integer')]
#[ORM\GeneratedValue(strategy: 'AUTO')]
#[Groups(['comment:read'])]
protected ?int $id = null;

@ -83,7 +83,7 @@ class ResourceFile implements Stringable
use TimestampableEntity;
#[Groups(['resource_file:read', 'resource_node:read', 'document:read', 'message:read'])]
#[ORM\Id]
#[ORM\Column(type: 'bigint')]
#[ORM\Column(type: 'integer')]
#[ORM\GeneratedValue]
protected ?int $id = null;
#[Assert\NotBlank]

@ -30,7 +30,7 @@ class ResourceLink implements Stringable
public const VISIBILITY_DELETED = 3;
#[ORM\Id]
#[ORM\Column(type: 'bigint')]
#[ORM\Column(type: 'integer')]
#[ORM\GeneratedValue]
protected ?int $id = null;

@ -78,7 +78,7 @@ class ResourceNode implements Stringable
#[Groups(['resource_node:read', 'document:read', 'ctool:read', 'user_json:read', 'course:read'])]
#[ORM\Id]
#[ORM\Column(type: 'bigint')]
#[ORM\Column(type: 'integer')]
#[ORM\GeneratedValue(strategy: 'AUTO')]
protected ?int $id = null;

@ -14,7 +14,7 @@ use Stringable;
class ResourceRight implements Stringable
{
#[ORM\Id]
#[ORM\Column(type: 'bigint')]
#[ORM\Column(type: 'integer')]
#[ORM\GeneratedValue(strategy: 'AUTO')]
protected ?int $id = null;

@ -79,7 +79,7 @@ class SocialPost
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(name: 'id', type: 'bigint')]
#[ORM\Column(name: 'id', type: 'integer')]
protected ?int $id = null;
#[Groups(['social_post:read', 'social_post:write'])]

@ -19,7 +19,7 @@ class SocialPostFeedback
{
use UserTrait;
#[ORM\Column(name: 'id', type: 'bigint')]
#[ORM\Column(name: 'id', type: 'integer')]
#[ORM\Id]
#[ORM\GeneratedValue]
protected ?int $id = null;

@ -34,7 +34,7 @@ class TrackELastaccess
#[ORM\Column(name: 'session_id', type: 'integer', nullable: true)]
protected ?int $sessionId = null;
#[ORM\Column(name: 'access_id', type: 'bigint')]
#[ORM\Column(name: 'access_id', type: 'integer')]
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'IDENTITY')]
protected int $accessId;

@ -83,7 +83,7 @@ class UserRelUser
public const USER_RELATION_TYPE_HRM_REQUEST = 9;
public const USER_RELATION_TYPE_FRIEND_REQUEST = 10;
#[ORM\Column(name: 'id', type: 'bigint')]
#[ORM\Column(name: 'id', type: 'integer')]
#[ORM\Id]
#[ORM\GeneratedValue]
protected ?int $id = null;

@ -342,7 +342,7 @@ class Version20 extends AbstractMigrationChamilo
}
if (false === $table->hasColumn('resource_node_id')) {
$this->addSql('ALTER TABLE usergroup ADD resource_node_id BIGINT DEFAULT NULL');
$this->addSql('ALTER TABLE usergroup ADD resource_node_id INT DEFAULT NULL');
}
// sequence_resource.

@ -20,13 +20,13 @@ class Version20170525122900 extends AbstractMigrationChamilo
{
if (false === $schema->hasTable('resource_file')) {
$this->addSql(
'CREATE TABLE resource_file (id BIGINT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, original_name LONGTEXT DEFAULT NULL, size INT NOT NULL, dimensions LONGTEXT DEFAULT NULL COMMENT "(DC2Type:simple_array)",crop VARCHAR(255) DEFAULT NULL, mime_type LONGTEXT DEFAULT NULL, description longtext DEFAULT NULL, metadata LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\', created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB ROW_FORMAT = DYNAMIC'
'CREATE TABLE resource_file (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, original_name LONGTEXT DEFAULT NULL, size INT NOT NULL, dimensions LONGTEXT DEFAULT NULL COMMENT "(DC2Type:simple_array)",crop VARCHAR(255) DEFAULT NULL, mime_type LONGTEXT DEFAULT NULL, description longtext DEFAULT NULL, metadata LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\', created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB ROW_FORMAT = DYNAMIC'
);
}
if (false === $schema->hasTable('resource_node')) {
$this->addSql(
'CREATE TABLE IF NOT EXISTS resource_node (id BIGINT AUTO_INCREMENT NOT NULL, resource_type_id INT NOT NULL, resource_file_id BIGINT DEFAULT NULL, creator_id INT NOT NULL, parent_id BIGINT DEFAULT NULL, name VARCHAR(255) NOT NULL, level INT DEFAULT NULL, path VARCHAR(3000) DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX IDX_8A5F48FF98EC6B7B (resource_type_id), UNIQUE INDEX UNIQ_8A5F48FFCE6B9E84 (resource_file_id), INDEX IDX_8A5F48FF61220EA6 (creator_id), INDEX IDX_8A5F48FF727ACA70 (parent_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB ROW_FORMAT = DYNAMIC;'
'CREATE TABLE IF NOT EXISTS resource_node (id INT AUTO_INCREMENT NOT NULL, resource_type_id INT NOT NULL, resource_file_id INT DEFAULT NULL, creator_id INT NOT NULL, parent_id INT DEFAULT NULL, name VARCHAR(255) NOT NULL, level INT DEFAULT NULL, path VARCHAR(3000) DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX IDX_8A5F48FF98EC6B7B (resource_type_id), UNIQUE INDEX UNIQ_8A5F48FFCE6B9E84 (resource_file_id), INDEX IDX_8A5F48FF61220EA6 (creator_id), INDEX IDX_8A5F48FF727ACA70 (parent_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB ROW_FORMAT = DYNAMIC;'
);
$this->addSql(
'ALTER TABLE resource_node ADD slug VARCHAR(255) NOT NULL, ADD uuid BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', CHANGE creator_id creator_id INT DEFAULT NULL, CHANGE path path LONGTEXT DEFAULT NULL, CHANGE name title VARCHAR(255) NOT NULL'
@ -40,13 +40,13 @@ class Version20170525122900 extends AbstractMigrationChamilo
if (!$schema->hasTable('resource_link')) {
$this->addSql(
"CREATE TABLE resource_link (id BIGINT AUTO_INCREMENT NOT NULL, resource_node_id BIGINT DEFAULT NULL, session_id INT DEFAULT NULL, user_id INT DEFAULT NULL, c_id INT DEFAULT NULL, group_id INT DEFAULT NULL, usergroup_id INT DEFAULT NULL, visibility INT NOT NULL, start_visibility_at DATETIME DEFAULT NULL, end_visibility_at DATETIME DEFAULT NULL, created_at DATETIME NOT NULL COMMENT '(DC2Type:datetime)', updated_at DATETIME NOT NULL COMMENT '(DC2Type:datetime)', INDEX IDX_398C394B1BAD783F (resource_node_id), INDEX IDX_398C394B613FECDF (session_id), INDEX IDX_398C394BA76ED395 (user_id), INDEX IDX_398C394B91D79BD3 (c_id), INDEX IDX_398C394BFE54D947 (group_id), INDEX IDX_398C394BD2112630 (usergroup_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB ROW_FORMAT = DYNAMIC;"
"CREATE TABLE resource_link (id INT AUTO_INCREMENT NOT NULL, resource_node_id INT DEFAULT NULL, session_id INT DEFAULT NULL, user_id INT DEFAULT NULL, c_id INT DEFAULT NULL, group_id INT DEFAULT NULL, usergroup_id INT DEFAULT NULL, visibility INT NOT NULL, start_visibility_at DATETIME DEFAULT NULL, end_visibility_at DATETIME DEFAULT NULL, created_at DATETIME NOT NULL COMMENT '(DC2Type:datetime)', updated_at DATETIME NOT NULL COMMENT '(DC2Type:datetime)', INDEX IDX_398C394B1BAD783F (resource_node_id), INDEX IDX_398C394B613FECDF (session_id), INDEX IDX_398C394BA76ED395 (user_id), INDEX IDX_398C394B91D79BD3 (c_id), INDEX IDX_398C394BFE54D947 (group_id), INDEX IDX_398C394BD2112630 (usergroup_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB ROW_FORMAT = DYNAMIC;"
);
}
if (!$schema->hasTable('resource_comment')) {
$this->addSql(
'CREATE TABLE resource_comment (id BIGINT AUTO_INCREMENT NOT NULL, resource_node_id BIGINT DEFAULT NULL, author_id INT DEFAULT NULL, parent_id BIGINT DEFAULT NULL, content VARCHAR(255) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, root INT DEFAULT NULL, lvl INT NOT NULL, lft INT NOT NULL, rgt INT NOT NULL, INDEX IDX_C9D4B5841BAD783F (resource_node_id), INDEX IDX_C9D4B584F675F31B (author_id), INDEX IDX_C9D4B584727ACA70 (parent_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB ROW_FORMAT = DYNAMIC;'
'CREATE TABLE resource_comment (id INT AUTO_INCREMENT NOT NULL, resource_node_id INT DEFAULT NULL, author_id INT DEFAULT NULL, parent_id INT DEFAULT NULL, content VARCHAR(255) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, root INT DEFAULT NULL, lvl INT NOT NULL, lft INT NOT NULL, rgt INT NOT NULL, INDEX IDX_C9D4B5841BAD783F (resource_node_id), INDEX IDX_C9D4B584F675F31B (author_id), INDEX IDX_C9D4B584727ACA70 (parent_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB ROW_FORMAT = DYNAMIC;'
);
$this->addSql(
'ALTER TABLE resource_comment ADD CONSTRAINT FK_C9D4B5841BAD783F FOREIGN KEY (resource_node_id) REFERENCES resource_node (id) ON DELETE CASCADE'
@ -61,7 +61,7 @@ class Version20170525122900 extends AbstractMigrationChamilo
if (false === $schema->hasTable('resource_tag')) {
$this->addSql(
'CREATE TABLE IF NOT EXISTS resource_tag (id BIGINT AUTO_INCREMENT NOT NULL, author_id INT DEFAULT NULL, name VARCHAR(255) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX IDX_23D039CAF675F31B (author_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB ROW_FORMAT = DYNAMIC;'
'CREATE TABLE IF NOT EXISTS resource_tag (id INT AUTO_INCREMENT NOT NULL, author_id INT DEFAULT NULL, name VARCHAR(255) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX IDX_23D039CAF675F31B (author_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB ROW_FORMAT = DYNAMIC;'
);
$this->addSql(
'ALTER TABLE resource_tag ADD CONSTRAINT FK_23D039CAF675F31B FOREIGN KEY (author_id) REFERENCES user (id) ON DELETE SET NULL;'
@ -70,7 +70,7 @@ class Version20170525122900 extends AbstractMigrationChamilo
if (false === $schema->hasTable('resource_user_tag')) {
$this->addSql(
'CREATE TABLE IF NOT EXISTS resource_user_tag (id BIGINT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, tag_id BIGINT DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX IDX_46131CA5A76ED395 (user_id), INDEX IDX_46131CA5BAD26311 (tag_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB ROW_FORMAT = DYNAMIC;'
'CREATE TABLE IF NOT EXISTS resource_user_tag (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, tag_id INT DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX IDX_46131CA5A76ED395 (user_id), INDEX IDX_46131CA5BAD26311 (tag_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB ROW_FORMAT = DYNAMIC;'
);
$this->addSql(
'ALTER TABLE resource_user_tag ADD CONSTRAINT FK_46131CA5A76ED395 FOREIGN KEY (user_id) REFERENCES user (id) ON DELETE SET NULL;'
@ -82,7 +82,7 @@ class Version20170525122900 extends AbstractMigrationChamilo
if (false === $schema->hasTable('personal_file')) {
$this->addSql(
'CREATE TABLE IF NOT EXISTS personal_file (id INT AUTO_INCREMENT NOT NULL, resource_node_id BIGINT DEFAULT NULL, title VARCHAR(255) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, UNIQUE INDEX UNIQ_BD95312D1BAD783F (resource_node_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB ROW_FORMAT = DYNAMIC;'
'CREATE TABLE IF NOT EXISTS personal_file (id INT AUTO_INCREMENT NOT NULL, resource_node_id INT DEFAULT NULL, title VARCHAR(255) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, UNIQUE INDEX UNIQ_BD95312D1BAD783F (resource_node_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB ROW_FORMAT = DYNAMIC;'
);
$this->addSql(
'ALTER TABLE personal_file ADD CONSTRAINT FK_BD95312D1BAD783F FOREIGN KEY (resource_node_id) REFERENCES resource_node (id) ON DELETE CASCADE;'
@ -123,7 +123,7 @@ class Version20170525122900 extends AbstractMigrationChamilo
if (false === $schema->hasTable('resource_right')) {
$this->addSql(
'CREATE TABLE IF NOT EXISTS resource_right (id BIGINT AUTO_INCREMENT NOT NULL, resource_link_id BIGINT DEFAULT NULL, role VARCHAR(255) NOT NULL, mask INT NOT NULL, INDEX IDX_9F710F26F004E599 (resource_link_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB ROW_FORMAT = DYNAMIC;'
'CREATE TABLE IF NOT EXISTS resource_right (id INT AUTO_INCREMENT NOT NULL, resource_link_id INT DEFAULT NULL, role VARCHAR(255) NOT NULL, mask INT NOT NULL, INDEX IDX_9F710F26F004E599 (resource_link_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB ROW_FORMAT = DYNAMIC;'
);
$this->addSql(
'ALTER TABLE resource_right ADD CONSTRAINT FK_9F710F26F004E599 FOREIGN KEY (resource_link_id) REFERENCES resource_link (id) ON DELETE CASCADE'
@ -159,7 +159,7 @@ class Version20170525122900 extends AbstractMigrationChamilo
if (false === $schema->hasTable('illustration')) {
$this->addSql(
"CREATE TABLE illustration (id BINARY(16) NOT NULL COMMENT '(DC2Type:uuid)', resource_node_id BIGINT DEFAULT NULL, name VARCHAR(255) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, UNIQUE INDEX UNIQ_D67B9A421BAD783F (resource_node_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB ROW_FORMAT = DYNAMIC;"
"CREATE TABLE illustration (id BINARY(16) NOT NULL COMMENT '(DC2Type:uuid)', resource_node_id INT DEFAULT NULL, name VARCHAR(255) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, UNIQUE INDEX UNIQ_D67B9A421BAD783F (resource_node_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB ROW_FORMAT = DYNAMIC;"
);
$this->addSql(
'ALTER TABLE illustration ADD CONSTRAINT FK_D67B9A421BAD783F FOREIGN KEY (resource_node_id) REFERENCES resource_node (id) ON DELETE CASCADE;'
@ -168,7 +168,7 @@ class Version20170525122900 extends AbstractMigrationChamilo
if (false === $schema->hasTable('c_shortcut')) {
$this->addSql(
'CREATE TABLE IF NOT EXISTS c_shortcut (id INT AUTO_INCREMENT NOT NULL, shortcut_node_id BIGINT DEFAULT NULL, resource_node_id BIGINT DEFAULT NULL, name VARCHAR(255) NOT NULL, UNIQUE INDEX UNIQ_3F6BB957937100BE (shortcut_node_id), UNIQUE INDEX UNIQ_3F6BB9571BAD783F (resource_node_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB ROW_FORMAT = DYNAMIC;'
'CREATE TABLE IF NOT EXISTS c_shortcut (id INT AUTO_INCREMENT NOT NULL, shortcut_node_id INT DEFAULT NULL, resource_node_id INT DEFAULT NULL, name VARCHAR(255) NOT NULL, UNIQUE INDEX UNIQ_3F6BB957937100BE (shortcut_node_id), UNIQUE INDEX UNIQ_3F6BB9571BAD783F (resource_node_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB ROW_FORMAT = DYNAMIC;'
);
$this->addSql(
'ALTER TABLE c_shortcut ADD CONSTRAINT FK_3F6BB957937100BE FOREIGN KEY (shortcut_node_id) REFERENCES resource_node (id) ON DELETE CASCADE;'

@ -26,7 +26,7 @@ class Version20170625122900 extends AbstractMigrationChamilo
$table = $schema->getTable('c_document');
if (false === $table->hasColumn('resource_node_id')) {
$this->addSql('ALTER TABLE c_document ADD resource_node_id BIGINT DEFAULT NULL');
$this->addSql('ALTER TABLE c_document ADD resource_node_id INT DEFAULT NULL');
$this->addSql(
'ALTER TABLE c_document ADD CONSTRAINT FK_C9FA0CBD1BAD783F FOREIGN KEY (resource_node_id) REFERENCES resource_node (id) ON DELETE CASCADE;'
);
@ -60,7 +60,7 @@ class Version20170625122900 extends AbstractMigrationChamilo
$table = $schema->getTable('c_announcement');
if (false === $table->hasColumn('resource_node_id')) {
$this->addSql('ALTER TABLE c_announcement ADD resource_node_id BIGINT DEFAULT NULL;');
$this->addSql('ALTER TABLE c_announcement ADD resource_node_id INT DEFAULT NULL;');
$this->addSql(
'ALTER TABLE c_announcement ADD CONSTRAINT FK_39912E021BAD783F FOREIGN KEY (resource_node_id) REFERENCES resource_node (id) ON DELETE CASCADE;'
);
@ -81,7 +81,7 @@ class Version20170625122900 extends AbstractMigrationChamilo
$this->addSql('ALTER TABLE c_announcement_attachment CHANGE announcement_id announcement_id INT DEFAULT NULL');
if (false === $table->hasColumn('resource_node_id')) {
$this->addSql('ALTER TABLE c_announcement_attachment ADD resource_node_id BIGINT DEFAULT NULL');
$this->addSql('ALTER TABLE c_announcement_attachment ADD resource_node_id INT DEFAULT NULL');
$this->addSql(
'ALTER TABLE c_announcement_attachment ADD CONSTRAINT FK_5480BD4A913AEA17 FOREIGN KEY (announcement_id) REFERENCES c_announcement (iid) ON DELETE CASCADE'
);

@ -30,7 +30,7 @@ class Version20170625123000 extends AbstractMigrationChamilo
$this->addSql('ALTER TABLE c_attendance CHANGE active active INT NOT NULL');
if (false === $table->hasColumn('resource_node_id')) {
$this->addSql('ALTER TABLE c_attendance ADD resource_node_id BIGINT DEFAULT NULL');
$this->addSql('ALTER TABLE c_attendance ADD resource_node_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE c_attendance ADD CONSTRAINT FK_413634921BAD783F FOREIGN KEY (resource_node_id) REFERENCES resource_node (id) ON DELETE CASCADE');
$this->addSql('CREATE UNIQUE INDEX UNIQ_413634921BAD783F ON c_attendance (resource_node_id)');
}

@ -20,7 +20,7 @@ class Version20170625143000 extends AbstractMigrationChamilo
{
$table = $schema->getTable('c_thematic');
if (false === $table->hasColumn('resource_node_id')) {
$this->addSql('ALTER TABLE c_thematic ADD resource_node_id BIGINT DEFAULT NULL');
$this->addSql('ALTER TABLE c_thematic ADD resource_node_id INT DEFAULT NULL');
$this->addSql(
'ALTER TABLE c_thematic ADD CONSTRAINT FK_6D8F59B91BAD783F FOREIGN KEY (resource_node_id) REFERENCES resource_node (id) ON DELETE CASCADE'
);
@ -83,7 +83,7 @@ class Version20170625143000 extends AbstractMigrationChamilo
/*
if (false === $table->hasColumn('resource_node_id')) {
$this->addSql('ALTER TABLE c_thematic_advance ADD resource_node_id BIGINT DEFAULT NULL');
$this->addSql('ALTER TABLE c_thematic_advance ADD resource_node_id INT DEFAULT NULL');
//$this->addSql('ALTER TABLE c_thematic_advance ADD CONSTRAINT FK_62798E971BAD783F FOREIGN KEY (resource_node_id) REFERENCES resource_node (id) ON DELETE CASCADE');
$this->addSql('CREATE UNIQUE INDEX UNIQ_62798E971BAD783F ON c_thematic_advance (resource_node_id)');
@ -111,7 +111,7 @@ class Version20170625143000 extends AbstractMigrationChamilo
/*
if (false === $table->hasColumn('resource_node_id')) {
$this->addSql('ALTER TABLE c_thematic_plan ADD resource_node_id BIGINT DEFAULT NULL');
$this->addSql('ALTER TABLE c_thematic_plan ADD resource_node_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE c_thematic_plan ADD CONSTRAINT FK_1197487C1BAD783F FOREIGN KEY (resource_node_id) REFERENCES resource_node (id) ON DELETE CASCADE');
$this->addSql('CREATE UNIQUE INDEX UNIQ_1197487C1BAD783F ON c_thematic_plan (resource_node_id)');
@ -120,7 +120,7 @@ class Version20170625143000 extends AbstractMigrationChamilo
// CLink
$table = $schema->getTable('c_link');
if (false === $table->hasColumn('resource_node_id')) {
$this->addSql('ALTER TABLE c_link ADD resource_node_id BIGINT DEFAULT NULL;');
$this->addSql('ALTER TABLE c_link ADD resource_node_id INT DEFAULT NULL;');
$this->addSql(
'ALTER TABLE c_link ADD CONSTRAINT FK_9209C2A01BAD783F FOREIGN KEY (resource_node_id) REFERENCES resource_node (id) ON DELETE CASCADE;'
);
@ -146,7 +146,7 @@ class Version20170625143000 extends AbstractMigrationChamilo
$table = $schema->getTable('c_link_category');
if (false === $table->hasColumn('resource_node_id')) {
$this->addSql('ALTER TABLE c_link_category ADD resource_node_id BIGINT DEFAULT NULL');
$this->addSql('ALTER TABLE c_link_category ADD resource_node_id INT DEFAULT NULL');
$this->addSql(
'ALTER TABLE c_link_category ADD CONSTRAINT FK_319D6C9C1BAD783F FOREIGN KEY (resource_node_id) REFERENCES resource_node (id) ON DELETE CASCADE'
);
@ -171,7 +171,7 @@ class Version20170625143000 extends AbstractMigrationChamilo
}
if (false === $table->hasColumn('resource_node_id')) {
$this->addSql('ALTER TABLE c_glossary ADD resource_node_id BIGINT DEFAULT NULL');
$this->addSql('ALTER TABLE c_glossary ADD resource_node_id INT DEFAULT NULL');
$this->addSql(
'ALTER TABLE c_glossary ADD CONSTRAINT FK_A1168D881BAD783F FOREIGN KEY (resource_node_id) REFERENCES resource_node (id) ON DELETE CASCADE'
);

@ -70,7 +70,7 @@ class Version20170625144000 extends AbstractMigrationChamilo
$this->addSql('ALTER TABLE c_student_publication CHANGE active active INT DEFAULT NULL');
if (false === $table->hasColumn('resource_node_id')) {
$this->addSql('ALTER TABLE c_student_publication ADD resource_node_id BIGINT DEFAULT NULL');
$this->addSql('ALTER TABLE c_student_publication ADD resource_node_id INT DEFAULT NULL');
$this->addSql(
'ALTER TABLE c_student_publication ADD CONSTRAINT FK_5246F7461BAD783F FOREIGN KEY (resource_node_id) REFERENCES resource_node (id) ON DELETE CASCADE'
);
@ -85,7 +85,7 @@ class Version20170625144000 extends AbstractMigrationChamilo
/*
if (false === $table->hasColumn('resource_node_id')) {
$this->addSql('ALTER TABLE c_student_publication_assignment ADD resource_node_id BIGINT DEFAULT NULL');
$this->addSql('ALTER TABLE c_student_publication_assignment ADD resource_node_id INT DEFAULT NULL');
$this->addSql(
'ALTER TABLE c_student_publication_assignment ADD CONSTRAINT FK_25687EB81BAD783F FOREIGN KEY (resource_node_id) REFERENCES resource_node (id) ON DELETE CASCADE'
);
@ -114,7 +114,7 @@ class Version20170625144000 extends AbstractMigrationChamilo
if (false === $schema->hasTable('c_student_publication_correction')) {
$this->addSql(
'CREATE TABLE c_student_publication_correction (id INT AUTO_INCREMENT NOT NULL, resource_node_id BIGINT DEFAULT NULL, title VARCHAR(255) NOT NULL, UNIQUE INDEX UNIQ_B7309BBA1BAD783F (resource_node_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB ROW_FORMAT = DYNAMIC'
'CREATE TABLE c_student_publication_correction (id INT AUTO_INCREMENT NOT NULL, resource_node_id INT DEFAULT NULL, title VARCHAR(255) NOT NULL, UNIQUE INDEX UNIQ_B7309BBA1BAD783F (resource_node_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB ROW_FORMAT = DYNAMIC'
);
$this->addSql(
'ALTER TABLE c_student_publication_correction ADD CONSTRAINT FK_B7309BBA1BAD783F FOREIGN KEY (resource_node_id) REFERENCES resource_node (id) ON DELETE CASCADE;'
@ -123,7 +123,7 @@ class Version20170625144000 extends AbstractMigrationChamilo
$table = $schema->getTable('c_student_publication_comment');
if (false === $table->hasColumn('resource_node_id')) {
$this->addSql('ALTER TABLE c_student_publication_comment ADD resource_node_id BIGINT DEFAULT NULL');
$this->addSql('ALTER TABLE c_student_publication_comment ADD resource_node_id INT DEFAULT NULL');
$this->addSql(
'ALTER TABLE c_student_publication_comment ADD CONSTRAINT FK_35C509F61BAD783F FOREIGN KEY (resource_node_id) REFERENCES resource_node (id) ON DELETE CASCADE'
);

@ -27,7 +27,7 @@ class Version20170625145000 extends AbstractMigrationChamilo
$this->addSql('UPDATE c_calendar_event SET title = "Event" WHERE title = "" AND content <> "" ');
if (!$table->hasColumn('resource_node_id')) {
$this->addSql('ALTER TABLE c_calendar_event ADD resource_node_id BIGINT DEFAULT NULL');
$this->addSql('ALTER TABLE c_calendar_event ADD resource_node_id INT DEFAULT NULL');
$this->addSql(
'ALTER TABLE c_calendar_event ADD CONSTRAINT FK_A0622581EE3A445A FOREIGN KEY (parent_event_id) REFERENCES c_calendar_event (iid)'
);
@ -76,7 +76,7 @@ class Version20170625145000 extends AbstractMigrationChamilo
$this->addSql('ALTER TABLE c_calendar_event_attachment CHANGE agenda_id agenda_id INT DEFAULT NULL');
if (false === $table->hasColumn('resource_node_id')) {
$this->addSql('ALTER TABLE c_calendar_event_attachment ADD resource_node_id BIGINT DEFAULT NULL');
$this->addSql('ALTER TABLE c_calendar_event_attachment ADD resource_node_id INT DEFAULT NULL');
$this->addSql(
'ALTER TABLE c_calendar_event_attachment ADD CONSTRAINT FK_DDD745A6EA67784A FOREIGN KEY (agenda_id) REFERENCES c_calendar_event (iid) ON DELETE CASCADE'
);

@ -22,7 +22,7 @@ class Version20170625153000 extends AbstractMigrationChamilo
$this->addSql('ALTER TABLE c_forum_attachment CHANGE post_id post_id INT DEFAULT NULL');
if (false === $table->hasColumn('resource_node_id')) {
$this->addSql('ALTER TABLE c_forum_attachment ADD resource_node_id BIGINT DEFAULT NULL');
$this->addSql('ALTER TABLE c_forum_attachment ADD resource_node_id INT DEFAULT NULL');
$this->addSql(
'ALTER TABLE c_forum_attachment ADD CONSTRAINT FK_F1113A884B89032C FOREIGN KEY (post_id) REFERENCES c_forum_post (iid) ON DELETE CASCADE'
);
@ -36,7 +36,7 @@ class Version20170625153000 extends AbstractMigrationChamilo
$table = $schema->getTable('c_forum_category');
if (false === $table->hasColumn('resource_node_id')) {
$this->addSql('ALTER TABLE c_forum_category ADD resource_node_id BIGINT DEFAULT NULL');
$this->addSql('ALTER TABLE c_forum_category ADD resource_node_id INT DEFAULT NULL');
$this->addSql(
'ALTER TABLE c_forum_category ADD CONSTRAINT FK_D627B86E1BAD783F FOREIGN KEY (resource_node_id) REFERENCES resource_node (id) ON DELETE CASCADE'
);
@ -53,7 +53,7 @@ class Version20170625153000 extends AbstractMigrationChamilo
$table = $schema->getTable('c_forum_forum');
if (!$table->hasColumn('resource_node_id')) {
$this->addSql('ALTER TABLE c_forum_forum ADD resource_node_id BIGINT DEFAULT NULL, DROP forum_id');
$this->addSql('ALTER TABLE c_forum_forum ADD resource_node_id INT DEFAULT NULL, DROP forum_id');
$this->addSql(
'ALTER TABLE c_forum_forum ADD CONSTRAINT FK_47A9C991BAD783F FOREIGN KEY (resource_node_id) REFERENCES resource_node (id) ON DELETE CASCADE'
);
@ -110,7 +110,7 @@ class Version20170625153000 extends AbstractMigrationChamilo
$this->addSql('ALTER TABLE c_forum_thread CHANGE thread_date thread_date DATETIME NOT NULL');
if (false === $table->hasColumn('resource_node_id')) {
$this->addSql('ALTER TABLE c_forum_thread ADD resource_node_id BIGINT DEFAULT NULL, DROP thread_id');
$this->addSql('ALTER TABLE c_forum_thread ADD resource_node_id INT DEFAULT NULL, DROP thread_id');
$this->addSql(
'ALTER TABLE c_forum_thread ADD CONSTRAINT FK_5DA7884C1BAD783F FOREIGN KEY (resource_node_id) REFERENCES resource_node (id) ON DELETE CASCADE'
);
@ -177,7 +177,7 @@ class Version20170625153000 extends AbstractMigrationChamilo
}
if (false === $table->hasColumn('resource_node_id')) {
$this->addSql('ALTER TABLE c_forum_post ADD resource_node_id BIGINT DEFAULT NULL');
$this->addSql('ALTER TABLE c_forum_post ADD resource_node_id INT DEFAULT NULL');
$this->addSql(
'ALTER TABLE c_forum_post ADD CONSTRAINT FK_B5BEF55929CCBAD0 FOREIGN KEY (forum_id) REFERENCES c_forum_forum (iid) ON DELETE SET NULL'
);

@ -20,7 +20,7 @@ class Version20170625154000 extends AbstractMigrationChamilo
{
$table = $schema->getTable('c_course_description');
if (false === $table->hasColumn('resource_node_id')) {
$this->addSql('ALTER TABLE c_course_description ADD resource_node_id BIGINT DEFAULT NULL');
$this->addSql('ALTER TABLE c_course_description ADD resource_node_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE c_course_description ADD CONSTRAINT FK_EC3CD8091BAD783F FOREIGN KEY (resource_node_id) REFERENCES resource_node (id) ON DELETE CASCADE');
$this->addSql('CREATE UNIQUE INDEX UNIQ_EC3CD8091BAD783F ON c_course_description (resource_node_id)');
}
@ -36,7 +36,7 @@ class Version20170625154000 extends AbstractMigrationChamilo
}
if (false === $table->hasColumn('resource_node_id')) {
$this->addSql('ALTER TABLE c_notebook ADD resource_node_id BIGINT DEFAULT NULL, DROP notebook_id');
$this->addSql('ALTER TABLE c_notebook ADD resource_node_id INT DEFAULT NULL, DROP notebook_id');
$this->addSql('ALTER TABLE c_notebook ADD CONSTRAINT FK_E7EE1CE01BAD783F FOREIGN KEY (resource_node_id) REFERENCES resource_node (id) ON DELETE CASCADE');
$this->addSql('CREATE UNIQUE INDEX UNIQ_E7EE1CE01BAD783F ON c_notebook (resource_node_id)');
}

@ -35,7 +35,7 @@ class Version20170626122900 extends AbstractMigrationChamilo
}
if (false === $table->hasColumn('resource_node_id')) {
$this->addSql('ALTER TABLE user ADD resource_node_id BIGINT DEFAULT NULL;');
$this->addSql('ALTER TABLE user ADD resource_node_id INT DEFAULT NULL;');
$this->addSql(
'ALTER TABLE user ADD CONSTRAINT FK_8D93D6491BAD783F FOREIGN KEY (resource_node_id) REFERENCES resource_node (id) ON DELETE CASCADE;'
);

@ -91,7 +91,7 @@ class Version20170628122900 extends AbstractMigrationChamilo
}
if (false === $table->hasColumn('resource_node_id')) {
$this->addSql('ALTER TABLE access_url ADD resource_node_id BIGINT DEFAULT NULL');
$this->addSql('ALTER TABLE access_url ADD resource_node_id INT DEFAULT NULL');
$this->addSql(
'ALTER TABLE access_url ADD CONSTRAINT FK_9436187B1BAD783F FOREIGN KEY (resource_node_id) REFERENCES resource_node (id) ON DELETE CASCADE;'
);

@ -20,9 +20,9 @@ class Version20170904145500 extends AbstractMigrationChamilo
{
if (false === $schema->hasTable('c_exercise_category')) {
$this->addSql(
'CREATE TABLE c_exercise_category (id BIGINT AUTO_INCREMENT NOT NULL, c_id INT NOT NULL, name VARCHAR(255) NOT NULL, description LONGTEXT DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, position INT NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'
'CREATE TABLE c_exercise_category (id INT AUTO_INCREMENT NOT NULL, c_id INT NOT NULL, name VARCHAR(255) NOT NULL, description LONGTEXT DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, position INT NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'
);
$this->addSql('ALTER TABLE c_exercise_category ADD resource_node_id BIGINT DEFAULT NULL');
$this->addSql('ALTER TABLE c_exercise_category ADD resource_node_id INT DEFAULT NULL');
$this->addSql(
'ALTER TABLE c_exercise_category ADD CONSTRAINT FK_B94C157E91D79BD3 FOREIGN KEY (c_id) REFERENCES course (id) ON DELETE CASCADE'
);
@ -40,14 +40,14 @@ class Version20170904145500 extends AbstractMigrationChamilo
$this->addSql('ALTER TABLE c_quiz CHANGE active active INT NOT NULL');
if ($table->hasColumn('exercise_category_id')) {
$this->addSql('ALTER TABLE c_quiz CHANGE exercise_category_id exercise_category_id BIGINT DEFAULT NULL;');
$this->addSql('ALTER TABLE c_quiz CHANGE exercise_category_id exercise_category_id INT DEFAULT NULL;');
if (false === $table->hasForeignKey('FK_B7A1C35FB48D66')) {
$this->addSql(
'ALTER TABLE c_quiz ADD CONSTRAINT FK_B7A1C35FB48D66 FOREIGN KEY (exercise_category_id) REFERENCES c_exercise_category (id) ON DELETE SET NULL'
);
}
} else {
$this->addSql('ALTER TABLE c_quiz ADD COLUMN exercise_category_id BIGINT DEFAULT NULL;');
$this->addSql('ALTER TABLE c_quiz ADD COLUMN exercise_category_id INT DEFAULT NULL;');
$this->addSql(
'ALTER TABLE c_quiz ADD CONSTRAINT FK_B7A1C35FB48D66 FOREIGN KEY (exercise_category_id) REFERENCES c_exercise_category (id) ON DELETE SET NULL'
);
@ -111,7 +111,7 @@ class Version20170904145500 extends AbstractMigrationChamilo
$this->addSql('ALTER TABLE c_quiz CHANGE type type INT NOT NULL');
if (false === $table->hasColumn('resource_node_id')) {
$this->addSql('ALTER TABLE c_quiz ADD COLUMN resource_node_id BIGINT DEFAULT NULL');
$this->addSql('ALTER TABLE c_quiz ADD COLUMN resource_node_id INT DEFAULT NULL');
$this->addSql(
'ALTER TABLE c_quiz ADD CONSTRAINT FK_B7A1C31BAD783F FOREIGN KEY (resource_node_id) REFERENCES resource_node (id) ON DELETE CASCADE'
);
@ -147,7 +147,7 @@ class Version20170904145500 extends AbstractMigrationChamilo
// c_quiz_question.
$table = $schema->getTable('c_quiz_question');
if (false === $table->hasColumn('resource_node_id')) {
$this->addSql('ALTER TABLE c_quiz_question ADD resource_node_id BIGINT DEFAULT NULL;');
$this->addSql('ALTER TABLE c_quiz_question ADD resource_node_id INT DEFAULT NULL;');
$this->addSql(
'ALTER TABLE c_quiz_question ADD CONSTRAINT FK_9A48A59F1BAD783F FOREIGN KEY (resource_node_id) REFERENCES resource_node (id) ON DELETE CASCADE;'
);
@ -270,7 +270,7 @@ class Version20170904145500 extends AbstractMigrationChamilo
$table = $schema->getTable('c_quiz_question_category');
if (false === $table->hasColumn('resource_node_id')) {
$this->addSql('ALTER TABLE c_quiz_question_category ADD resource_node_id BIGINT DEFAULT NULL');
$this->addSql('ALTER TABLE c_quiz_question_category ADD resource_node_id INT DEFAULT NULL');
$this->addSql(
'ALTER TABLE c_quiz_question_category ADD CONSTRAINT FK_1414369D1BAD783F FOREIGN KEY (resource_node_id) REFERENCES resource_node (id) ON DELETE CASCADE'
);

@ -34,7 +34,7 @@ class Version20170904173000 extends AbstractMigrationChamilo
}
if (false === $table->hasColumn('resource_node_id')) {
$this->addSql('ALTER TABLE c_group_info ADD resource_node_id BIGINT DEFAULT NULL');
$this->addSql('ALTER TABLE c_group_info ADD resource_node_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE c_group_info ADD CONSTRAINT FK_CE0653241BAD783F FOREIGN KEY (resource_node_id) REFERENCES resource_node (id) ON DELETE CASCADE');
$this->addSql('CREATE UNIQUE INDEX UNIQ_CE0653241BAD783F ON c_group_info (resource_node_id)');
}
@ -100,7 +100,7 @@ class Version20170904173000 extends AbstractMigrationChamilo
}
if (false === $table->hasColumn('resource_node_id')) {
$this->addSql('ALTER TABLE c_group_category ADD resource_node_id BIGINT DEFAULT NULL');
$this->addSql('ALTER TABLE c_group_category ADD resource_node_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE c_group_category ADD CONSTRAINT FK_F8E479F61BAD783F FOREIGN KEY (resource_node_id) REFERENCES resource_node (id) ON DELETE CASCADE');
$this->addSql('CREATE UNIQUE INDEX UNIQ_F8E479F61BAD783F ON c_group_category (resource_node_id)');
}

@ -54,7 +54,7 @@ class Version20180319145700 extends AbstractMigrationChamilo
}
if (false === $survey->hasColumn('resource_node_id')) {
$this->addSql('ALTER TABLE c_survey ADD resource_node_id BIGINT DEFAULT NULL');
$this->addSql('ALTER TABLE c_survey ADD resource_node_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE c_survey ADD CONSTRAINT FK_F246DB301BAD783F FOREIGN KEY (resource_node_id) REFERENCES resource_node (id) ON DELETE CASCADE');
$this->addSql('CREATE UNIQUE INDEX UNIQ_F246DB301BAD783F ON c_survey (resource_node_id);');
}

@ -70,7 +70,7 @@ class Version20180928172830 extends AbstractMigrationChamilo
$this->addSql('UPDATE c_tool SET tool_id = (SELECT id FROM tool WHERE name = c_tool.name) WHERE tool_id IS NOT NULL');
if (!$table->hasColumn('resource_node_id')) {
$this->addSql('ALTER TABLE c_tool ADD resource_node_id BIGINT DEFAULT NULL');
$this->addSql('ALTER TABLE c_tool ADD resource_node_id INT DEFAULT NULL');
}
// @todo remove/move LP/Link shortcuts.

@ -377,7 +377,7 @@ class Version20181025064351 extends AbstractMigrationChamilo
$table = $schema->hasTable('gradebook_comment');
if (false === $table) {
$this->addSql('CREATE TABLE gradebook_comment (id BIGINT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, gradebook_id INT DEFAULT NULL, comment LONGTEXT NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX IDX_C3B70763A76ED395 (user_id), INDEX IDX_C3B70763AD3ED51C (gradebook_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB ROW_FORMAT = DYNAMIC;');
$this->addSql('CREATE TABLE gradebook_comment (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, gradebook_id INT DEFAULT NULL, comment LONGTEXT NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX IDX_C3B70763A76ED395 (user_id), INDEX IDX_C3B70763AD3ED51C (gradebook_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB ROW_FORMAT = DYNAMIC;');
$this->addSql('ALTER TABLE gradebook_comment ADD CONSTRAINT FK_C3B70763A76ED395 FOREIGN KEY (user_id) REFERENCES user (id) ON DELETE CASCADE;');
$this->addSql('ALTER TABLE gradebook_comment ADD CONSTRAINT FK_C3B70763AD3ED51C FOREIGN KEY (gradebook_id) REFERENCES gradebook_category (id) ON DELETE CASCADE;');
}

@ -27,7 +27,7 @@ class Version20190110182615 extends AbstractMigrationChamilo
$table = $schema->getTable('c_lp');
if (false === $table->hasColumn('resource_node_id')) {
$this->addSql('ALTER TABLE c_lp ADD resource_node_id BIGINT DEFAULT NULL;');
$this->addSql('ALTER TABLE c_lp ADD resource_node_id INT DEFAULT NULL;');
$this->addSql(
'ALTER TABLE c_lp ADD CONSTRAINT FK_F67ABBEB1BAD783F FOREIGN KEY (resource_node_id) REFERENCES resource_node (id) ON DELETE CASCADE;'
);
@ -81,7 +81,7 @@ class Version20190110182615 extends AbstractMigrationChamilo
}
if (false === $table->hasColumn('resource_node_id')) {
$this->addSql('ALTER TABLE c_lp_category ADD resource_node_id BIGINT DEFAULT NULL');
$this->addSql('ALTER TABLE c_lp_category ADD resource_node_id INT DEFAULT NULL');
}
if ($table->hasIndex('course')) {

@ -20,7 +20,7 @@ class Version20190110182620 extends AbstractMigrationChamilo
{
$table = $schema->getTable('c_blog');
if (false === $table->hasColumn('resource_node_id')) {
$this->addSql('ALTER TABLE c_blog ADD resource_node_id BIGINT DEFAULT NULL;');
$this->addSql('ALTER TABLE c_blog ADD resource_node_id INT DEFAULT NULL;');
$this->addSql(
'ALTER TABLE c_blog ADD CONSTRAINT FK_64B00A121BAD783F FOREIGN KEY (resource_node_id) REFERENCES resource_node (id) ON DELETE CASCADE;'
);
@ -29,7 +29,7 @@ class Version20190110182620 extends AbstractMigrationChamilo
$table = $schema->getTable('c_wiki');
if (false === $table->hasColumn('resource_node_id')) {
$this->addSql('ALTER TABLE c_wiki ADD resource_node_id BIGINT DEFAULT NULL;');
$this->addSql('ALTER TABLE c_wiki ADD resource_node_id INT DEFAULT NULL;');
$this->addSql(
'ALTER TABLE c_wiki ADD CONSTRAINT FK_866887571BAD783F FOREIGN KEY (resource_node_id) REFERENCES resource_node (id) ON DELETE CASCADE;'
);

@ -39,7 +39,7 @@ class Version20191101132000 extends AbstractMigrationChamilo
}
if (!$table->hasColumn('resource_node_id')) {
$this->addSql('ALTER TABLE course ADD COLUMN resource_node_id BIGINT DEFAULT NULL;');
$this->addSql('ALTER TABLE course ADD COLUMN resource_node_id INT DEFAULT NULL;');
$this->addSql(
'ALTER TABLE course ADD CONSTRAINT FK_169E6FB91BAD783F FOREIGN KEY (resource_node_id) REFERENCES resource_node (id) ON DELETE CASCADE;'
);
@ -197,7 +197,7 @@ class Version20191101132000 extends AbstractMigrationChamilo
$this->addSql('ALTER TABLE c_tool_intro CHANGE id id VARCHAR(255) DEFAULT NULL');
if (!$table->hasColumn('resource_node_id')) {
$this->addSql('ALTER TABLE c_tool_intro ADD resource_node_id BIGINT DEFAULT NULL');
$this->addSql('ALTER TABLE c_tool_intro ADD resource_node_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE c_tool_intro ADD CONSTRAINT FK_D705267B1BAD783F FOREIGN KEY (resource_node_id) REFERENCES resource_node (id) ON DELETE CASCADE;');
$this->addSql('CREATE UNIQUE INDEX UNIQ_D705267B1BAD783F ON c_tool_intro (resource_node_id);');
}

@ -21,7 +21,7 @@ final class Version20200821224242 extends AbstractMigrationChamilo
$connection = $this->getEntityManager()->getConnection();
$table = $schema->getTable('message');
$this->addSql('ALTER TABLE message CHANGE parent_id parent_id BIGINT DEFAULT NULL');
$this->addSql('ALTER TABLE message CHANGE parent_id parent_id INT DEFAULT NULL');
if ($table->hasColumn('msg_status')) {
$this->addSql('ALTER TABLE message CHANGE msg_status msg_type SMALLINT NOT NULL');
@ -87,10 +87,10 @@ final class Version20200821224242 extends AbstractMigrationChamilo
if (!$schema->hasTable('message_rel_user')) {
$this->addSql(
'CREATE TABLE message_rel_user (id BIGINT AUTO_INCREMENT NOT NULL, message_id BIGINT NOT NULL, user_id INT NOT NULL, msg_read TINYINT(1) NOT NULL, starred TINYINT(1) NOT NULL, receiver_type SMALLINT NOT NULL, INDEX IDX_325D70B9537A1329 (message_id), INDEX IDX_325D70B9A76ED395 (user_id), UNIQUE INDEX message_receiver (message_id, user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB ROW_FORMAT = DYNAMIC'
'CREATE TABLE message_rel_user (id INT AUTO_INCREMENT NOT NULL, message_id INT NOT NULL, user_id INT NOT NULL, msg_read TINYINT(1) NOT NULL, starred TINYINT(1) NOT NULL, receiver_type SMALLINT NOT NULL, INDEX IDX_325D70B9537A1329 (message_id), INDEX IDX_325D70B9A76ED395 (user_id), UNIQUE INDEX message_receiver (message_id, user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB ROW_FORMAT = DYNAMIC'
);
$this->addSql(
'CREATE TABLE message_rel_user_rel_tags (message_rel_user_id BIGINT NOT NULL, message_tag_id BIGINT NOT NULL, INDEX IDX_B4B37A20962B5422 (message_rel_user_id), INDEX IDX_B4B37A208DF5FE1E (message_tag_id), PRIMARY KEY(message_rel_user_id, message_tag_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB ROW_FORMAT = DYNAMIC'
'CREATE TABLE message_rel_user_rel_tags (message_rel_user_id INT NOT NULL, message_tag_id INT NOT NULL, INDEX IDX_B4B37A20962B5422 (message_rel_user_id), INDEX IDX_B4B37A208DF5FE1E (message_tag_id), PRIMARY KEY(message_rel_user_id, message_tag_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB ROW_FORMAT = DYNAMIC'
);
$this->addSql(
'ALTER TABLE message_rel_user ADD CONSTRAINT FK_325D70B9537A1329 FOREIGN KEY (message_id) REFERENCES message (id)'
@ -165,7 +165,7 @@ final class Version20200821224242 extends AbstractMigrationChamilo
// $this->addSql('ALTER TABLE message CHANGE msg_status msg_status SMALLINT NOT NULL;');
$this->addSql("CREATE TABLE social_post (id BIGINT AUTO_INCREMENT NOT NULL, sender_id INT NOT NULL, user_receiver_id INT DEFAULT NULL, group_receiver_id INT DEFAULT NULL, parent_id BIGINT DEFAULT NULL, subject LONGTEXT DEFAULT NULL, content LONGTEXT NOT NULL, type SMALLINT NOT NULL, status SMALLINT NOT NULL, send_date DATETIME NOT NULL COMMENT '(DC2Type:datetime)', updated_at DATETIME NOT NULL COMMENT '(DC2Type:datetime)', INDEX IDX_159BBFE9727ACA70 (parent_id), INDEX idx_social_post_sender (sender_id), INDEX idx_social_post_user (user_receiver_id), INDEX idx_social_post_group (group_receiver_id), INDEX idx_social_post_type (type), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB ROW_FORMAT = DYNAMIC");
$this->addSql("CREATE TABLE social_post (id INT AUTO_INCREMENT NOT NULL, sender_id INT NOT NULL, user_receiver_id INT DEFAULT NULL, group_receiver_id INT DEFAULT NULL, parent_id INT DEFAULT NULL, subject LONGTEXT DEFAULT NULL, content LONGTEXT NOT NULL, type SMALLINT NOT NULL, status SMALLINT NOT NULL, send_date DATETIME NOT NULL COMMENT '(DC2Type:datetime)', updated_at DATETIME NOT NULL COMMENT '(DC2Type:datetime)', INDEX IDX_159BBFE9727ACA70 (parent_id), INDEX idx_social_post_sender (sender_id), INDEX idx_social_post_user (user_receiver_id), INDEX idx_social_post_group (group_receiver_id), INDEX idx_social_post_type (type), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB ROW_FORMAT = DYNAMIC");
$sql = 'INSERT INTO social_post (id, sender_id, user_receiver_id, group_receiver_id, parent_id, subject, content, type, status, send_date, updated_at)
SELECT DISTINCT m.id,
@ -223,14 +223,14 @@ final class Version20200821224242 extends AbstractMigrationChamilo
$this->addSql('DROP INDEX idx_message_feedback_uid_mid ON message_feedback');
}
$this->addSql('ALTER TABLE message_feedback CHANGE message_id social_post_id BIGINT NOT NULL');
$this->addSql('ALTER TABLE message_feedback CHANGE message_id social_post_id INT NOT NULL');
$this->addSql('RENAME TABLE message_feedback TO social_post_feedback');
$this->addSql('DELETE FROM social_post_feedback WHERE social_post_id NOT IN (SELECT id FROM social_post)');
$this->addSql('CREATE INDEX IDX_DB7E436DA76ED395 ON social_post_feedback (user_id)');
$this->addSql('CREATE INDEX IDX_DB7E436DC4F2D6B1 ON social_post_feedback (social_post_id)');
$this->addSql('CREATE INDEX idx_social_post_uid_spid ON social_post_feedback (social_post_id, user_id)');
} else {
$this->addSql("CREATE TABLE social_post_feedback (id BIGINT AUTO_INCREMENT NOT NULL, social_post_id BIGINT NOT NULL, user_id INT NOT NULL, liked TINYINT(1) DEFAULT '0' NOT NULL, disliked TINYINT(1) DEFAULT '0' NOT NULL, updated_at DATETIME NOT NULL COMMENT '(DC2Type:datetime)', INDEX IDX_DB7E436DC4F2D6B1 (social_post_id), INDEX IDX_DB7E436DA76ED395 (user_id), INDEX idx_social_post_uid_spid (social_post_id, user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB ROW_FORMAT = DYNAMIC");
$this->addSql("CREATE TABLE social_post_feedback (id INT AUTO_INCREMENT NOT NULL, social_post_id INT NOT NULL, user_id INT NOT NULL, liked TINYINT(1) DEFAULT '0' NOT NULL, disliked TINYINT(1) DEFAULT '0' NOT NULL, updated_at DATETIME NOT NULL COMMENT '(DC2Type:datetime)', INDEX IDX_DB7E436DC4F2D6B1 (social_post_id), INDEX IDX_DB7E436DA76ED395 (user_id), INDEX idx_social_post_uid_spid (social_post_id, user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB ROW_FORMAT = DYNAMIC");
}
$this->addSql('ALTER TABLE social_post_feedback ADD CONSTRAINT FK_DB7E436DA76ED395 FOREIGN KEY (user_id) REFERENCES user (id) ON DELETE CASCADE');
@ -244,14 +244,14 @@ final class Version20200821224242 extends AbstractMigrationChamilo
if (false === $table->hasIndex('IDX_B68FF524537A1329')) {
$this->addSql('CREATE INDEX IDX_B68FF524537A1329 ON message_attachment (message_id)');
}
$this->addSql('ALTER TABLE message_attachment CHANGE message_id message_id BIGINT NOT NULL');
$this->addSql('ALTER TABLE message_attachment CHANGE message_id message_id INT NOT NULL');
if (false === $table->hasForeignKey('FK_B68FF524537A1329')) {
$this->addSql('ALTER TABLE message_attachment ADD CONSTRAINT FK_B68FF524537A1329 FOREIGN KEY (message_id) REFERENCES message (id)');
}
if (!$table->hasColumn('resource_node_id')) {
$this->addSql('ALTER TABLE message_attachment ADD resource_node_id BIGINT DEFAULT NULL;');
$this->addSql('ALTER TABLE message_attachment ADD resource_node_id INT DEFAULT NULL;');
$this->addSql('CREATE UNIQUE INDEX UNIQ_B68FF5241BAD783F ON message_attachment (resource_node_id);');
}
@ -260,13 +260,13 @@ final class Version20200821224242 extends AbstractMigrationChamilo
}
if (!$schema->hasTable('c_chat_conversation')) {
$this->addSql('CREATE TABLE c_chat_conversation (id INT AUTO_INCREMENT NOT NULL, resource_node_id BIGINT DEFAULT NULL, name VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_CD09E33F1BAD783F (resource_node_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB ROW_FORMAT = DYNAMIC;');
$this->addSql('CREATE TABLE c_chat_conversation (id INT AUTO_INCREMENT NOT NULL, resource_node_id INT DEFAULT NULL, name VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_CD09E33F1BAD783F (resource_node_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB ROW_FORMAT = DYNAMIC;');
$this->addSql('ALTER TABLE c_chat_conversation ADD CONSTRAINT FK_CD09E33F1BAD783F FOREIGN KEY (resource_node_id) REFERENCES resource_node (id) ON DELETE CASCADE');
}
if (!$schema->hasTable('message_tag')) {
$this->addSql("CREATE TABLE message_tag (id BIGINT AUTO_INCREMENT NOT NULL, user_id INT NOT NULL, tag VARCHAR(255) NOT NULL, color VARCHAR(255) NOT NULL, position INT NOT NULL, created_at DATETIME NOT NULL COMMENT '(DC2Type:datetime)', updated_at DATETIME NOT NULL COMMENT '(DC2Type:datetime)', INDEX IDX_2ABC3D6FA76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB ROW_FORMAT = DYNAMIC;");
$this->addSql('CREATE TABLE message_rel_tags (message_id BIGINT NOT NULL, message_tag_id BIGINT NOT NULL, INDEX IDX_D07232D6537A1329 (message_id), INDEX IDX_D07232D68DF5FE1E (message_tag_id), PRIMARY KEY(message_id, message_tag_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB ROW_FORMAT = DYNAMIC;');
$this->addSql("CREATE TABLE message_tag (id INT AUTO_INCREMENT NOT NULL, user_id INT NOT NULL, tag VARCHAR(255) NOT NULL, color VARCHAR(255) NOT NULL, position INT NOT NULL, created_at DATETIME NOT NULL COMMENT '(DC2Type:datetime)', updated_at DATETIME NOT NULL COMMENT '(DC2Type:datetime)', INDEX IDX_2ABC3D6FA76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB ROW_FORMAT = DYNAMIC;");
$this->addSql('CREATE TABLE message_rel_tags (message_id INT NOT NULL, message_tag_id INT NOT NULL, INDEX IDX_D07232D6537A1329 (message_id), INDEX IDX_D07232D68DF5FE1E (message_tag_id), PRIMARY KEY(message_id, message_tag_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB ROW_FORMAT = DYNAMIC;');
$this->addSql('ALTER TABLE message_tag ADD CONSTRAINT FK_2ABC3D6FA76ED395 FOREIGN KEY (user_id) REFERENCES user (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE message_rel_tags ADD CONSTRAINT FK_D07232D6537A1329 FOREIGN KEY (message_id) REFERENCES message (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE message_rel_tags ADD CONSTRAINT FK_D07232D68DF5FE1E FOREIGN KEY (message_tag_id) REFERENCES message_tag (id) ON DELETE CASCADE');

@ -68,7 +68,7 @@ class Version20211005153900 extends AbstractMigrationChamilo
}
if (!$table->hasColumn('resource_node_id')) {
$this->addSql('ALTER TABLE ticket_message_attachments ADD resource_node_id BIGINT DEFAULT NULL;');
$this->addSql('ALTER TABLE ticket_message_attachments ADD resource_node_id INT DEFAULT NULL;');
$this->addSql(
'ALTER TABLE ticket_message_attachments ADD CONSTRAINT FK_70BF9E261BAD783F FOREIGN KEY (resource_node_id) REFERENCES resource_node (id) ON DELETE CASCADE;'
);

@ -17,8 +17,8 @@ final class Version20211026140820 extends AbstractMigrationChamilo
public function up(Schema $schema): void
{
if (false === $schema->hasTable('page')) {
$this->addSql("CREATE TABLE page (id BIGINT AUTO_INCREMENT NOT NULL, access_url_id INT DEFAULT NULL, creator_id INT DEFAULT NULL, category_id BIGINT DEFAULT NULL, title VARCHAR(255) NOT NULL, content LONGTEXT NOT NULL, slug VARCHAR(255) NOT NULL, enabled TINYINT(1) NOT NULL, position INT NOT NULL, locale VARCHAR(10) NOT NULL, created_at DATETIME NOT NULL COMMENT '(DC2Type:datetime)', updated_at DATETIME NOT NULL COMMENT '(DC2Type:datetime)', INDEX IDX_140AB62073444FD5 (access_url_id), INDEX IDX_140AB62061220EA6 (creator_id), INDEX IDX_140AB62012469DE2 (category_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB ROW_FORMAT = DYNAMIC;");
$this->addSql("CREATE TABLE page_category (id BIGINT AUTO_INCREMENT NOT NULL, creator_id INT DEFAULT NULL, title VARCHAR(255) NOT NULL, type VARCHAR(255) NOT NULL, created_at DATETIME NOT NULL COMMENT '(DC2Type:datetime)', updated_at DATETIME NOT NULL COMMENT '(DC2Type:datetime)', INDEX IDX_86D31EE161220EA6 (creator_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB ROW_FORMAT = DYNAMIC;");
$this->addSql("CREATE TABLE page (id INT AUTO_INCREMENT NOT NULL, access_url_id INT DEFAULT NULL, creator_id INT DEFAULT NULL, category_id INT DEFAULT NULL, title VARCHAR(255) NOT NULL, content LONGTEXT NOT NULL, slug VARCHAR(255) NOT NULL, enabled TINYINT(1) NOT NULL, position INT NOT NULL, locale VARCHAR(10) NOT NULL, created_at DATETIME NOT NULL COMMENT '(DC2Type:datetime)', updated_at DATETIME NOT NULL COMMENT '(DC2Type:datetime)', INDEX IDX_140AB62073444FD5 (access_url_id), INDEX IDX_140AB62061220EA6 (creator_id), INDEX IDX_140AB62012469DE2 (category_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB ROW_FORMAT = DYNAMIC;");
$this->addSql("CREATE TABLE page_category (id INT AUTO_INCREMENT NOT NULL, creator_id INT DEFAULT NULL, title VARCHAR(255) NOT NULL, type VARCHAR(255) NOT NULL, created_at DATETIME NOT NULL COMMENT '(DC2Type:datetime)', updated_at DATETIME NOT NULL COMMENT '(DC2Type:datetime)', INDEX IDX_86D31EE161220EA6 (creator_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB ROW_FORMAT = DYNAMIC;");
$this->addSql('ALTER TABLE page ADD CONSTRAINT FK_140AB62073444FD5 FOREIGN KEY (access_url_id) REFERENCES access_url (id) ON DELETE CASCADE;');
$this->addSql('ALTER TABLE page ADD CONSTRAINT FK_140AB62061220EA6 FOREIGN KEY (creator_id) REFERENCES user (id) ON DELETE CASCADE;');

@ -62,7 +62,7 @@ final class Version20230216122950 extends AbstractMigrationChamilo
if (!$schema->hasTable('agenda_reminder')) {
$this->addSql(
'CREATE TABLE agenda_reminder (id BIGINT AUTO_INCREMENT NOT NULL, type VARCHAR(255) NOT NULL, event_id INT NOT NULL, date_interval VARCHAR(255) NOT NULL COMMENT "(DC2Type:dateinterval)", sent TINYINT(1) NOT NULL, created_at DATETIME NOT NULL COMMENT "(DC2Type:datetime)", updated_at DATETIME NOT NULL COMMENT "(DC2Type:datetime)", PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB ROW_FORMAT = DYNAMIC;'
'CREATE TABLE agenda_reminder (id INT AUTO_INCREMENT NOT NULL, type VARCHAR(255) NOT NULL, event_id INT NOT NULL, date_interval VARCHAR(255) NOT NULL COMMENT "(DC2Type:dateinterval)", sent TINYINT(1) NOT NULL, created_at DATETIME NOT NULL COMMENT "(DC2Type:datetime)", updated_at DATETIME NOT NULL COMMENT "(DC2Type:datetime)", PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB ROW_FORMAT = DYNAMIC;'
);
}
@ -77,7 +77,7 @@ final class Version20230216122950 extends AbstractMigrationChamilo
if (!$schema->hasTable('message_feedback')) {
$this->addSql(
'CREATE TABLE message_feedback (id BIGINT AUTO_INCREMENT NOT NULL, message_id BIGINT NOT NULL, user_id INT NOT NULL, liked TINYINT(1) DEFAULT 0 NOT NULL, disliked TINYINT(1) DEFAULT 0 NOT NULL, updated_at DATETIME NOT NULL COMMENT "(DC2Type:datetime)", INDEX IDX_DB0F8049537A1329 (message_id), INDEX IDX_DB0F8049A76ED395 (user_id), INDEX idx_message_feedback_uid_mid (message_id, user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB ROW_FORMAT = DYNAMIC'
'CREATE TABLE message_feedback (id INT AUTO_INCREMENT NOT NULL, message_id INT NOT NULL, user_id INT NOT NULL, liked TINYINT(1) DEFAULT 0 NOT NULL, disliked TINYINT(1) DEFAULT 0 NOT NULL, updated_at DATETIME NOT NULL COMMENT "(DC2Type:datetime)", INDEX IDX_DB0F8049537A1329 (message_id), INDEX IDX_DB0F8049A76ED395 (user_id), INDEX idx_message_feedback_uid_mid (message_id, user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB ROW_FORMAT = DYNAMIC'
);
$this->addSql(
'ALTER TABLE message_feedback ADD CONSTRAINT FK_DB0F8049537A1329 FOREIGN KEY (message_id) REFERENCES message (id) ON DELETE CASCADE'

@ -19,7 +19,7 @@ final class Version20230720222130 extends AbstractMigrationChamilo
public function up(Schema $schema): void
{
if (false === $schema->hasTable('social_post_attachments')) {
$this->addSql("CREATE TABLE social_post_attachments (id INT AUTO_INCREMENT NOT NULL, social_post_id BIGINT DEFAULT NULL, resource_node_id BIGINT DEFAULT NULL, path VARCHAR(255) NOT NULL, filename LONGTEXT NOT NULL, size INT NOT NULL, sys_insert_user_id INT NOT NULL, sys_insert_datetime DATETIME NOT NULL COMMENT '(DC2Type:datetime)', sys_lastedit_user_id INT DEFAULT NULL, sys_lastedit_datetime DATETIME DEFAULT NULL COMMENT '(DC2Type:datetime)', INDEX IDX_DF2A8F34C4F2D6B1 (social_post_id), UNIQUE INDEX UNIQ_DF2A8F341BAD783F (resource_node_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB ROW_FORMAT = DYNAMIC;");
$this->addSql("CREATE TABLE social_post_attachments (id INT AUTO_INCREMENT NOT NULL, social_post_id INT DEFAULT NULL, resource_node_id INT DEFAULT NULL, path VARCHAR(255) NOT NULL, filename LONGTEXT NOT NULL, size INT NOT NULL, sys_insert_user_id INT NOT NULL, sys_insert_datetime DATETIME NOT NULL COMMENT '(DC2Type:datetime)', sys_lastedit_user_id INT DEFAULT NULL, sys_lastedit_datetime DATETIME DEFAULT NULL COMMENT '(DC2Type:datetime)', INDEX IDX_DF2A8F34C4F2D6B1 (social_post_id), UNIQUE INDEX UNIQ_DF2A8F341BAD783F (resource_node_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB ROW_FORMAT = DYNAMIC;");
$this->addSql('ALTER TABLE social_post_attachments ADD CONSTRAINT FK_DF2A8F34C4F2D6B1 FOREIGN KEY (social_post_id) REFERENCES social_post (id) ON DELETE CASCADE;');
$this->addSql('ALTER TABLE social_post_attachments ADD CONSTRAINT FK_DF2A8F341BAD783F FOREIGN KEY (resource_node_id) REFERENCES resource_node (id) ON DELETE CASCADE;');
}

@ -0,0 +1,45 @@
<?php
/* For licensing terms, see /license.txt */
declare(strict_types=1);
namespace Chamilo\CoreBundle\Migrations\Schema\V200;
use Chamilo\CoreBundle\Entity\Course;
use Chamilo\CoreBundle\Migrations\AbstractMigrationChamilo;
use Doctrine\DBAL\Connection;
use Doctrine\DBAL\Schema\Schema;
final class Version20240112103400 extends AbstractMigrationChamilo
{
public function getDescription(): string
{
return 'Change disk_quota of course to megabyte';
}
public function up(Schema $schema): void
{
$container = $this->getContainer();
$em = $this->getEntityManager();
/** @var Connection $connection */
$connection = $em->getConnection();
$kernel = $container->get('kernel');
$rootPath = $kernel->getProjectDir();
$q = $em->createQuery('SELECT c FROM Chamilo\CoreBundle\Entity\Course c');
/** @var Course $course */
foreach ($q->toIterable() as $course) {
$diskQuotaInBytes = $course->getDiskQuota();
if ($diskQuotaInBytes !== null) {
$diskQuotaInMegabytes = $diskQuotaInBytes / (1024 * 1024);
$course->setDiskQuota($diskQuotaInMegabytes);
$em->persist($course);
}
$em->flush();
}
}
}

@ -0,0 +1,396 @@
<?php
/* For licensing terms, see /license.txt */
declare(strict_types=1);
namespace Chamilo\CoreBundle\Migrations\Schema\V200;
use Chamilo\CoreBundle\Migrations\AbstractMigrationChamilo;
use Doctrine\DBAL\Schema\Schema;
final class Version20240112131200 extends AbstractMigrationChamilo
{
public function getDescription(): string
{
return 'Changes fields type bigint by integer';
}
public function up(Schema $schema): void
{
error_log('Changes fields type bigint by integer');
// Temporarily disable foreign key and unique checks to prevent errors during the schema changes
$this->addSql('SET FOREIGN_KEY_CHECKS=0;');
$this->addSql('SET UNIQUE_CHECKS=0;');
if ($schema->hasTable('user_rel_user')) {
error_log('Perform the changes in the user_rel_user table');
$this->addSql("ALTER TABLE user_rel_user CHANGE id id INT AUTO_INCREMENT NOT NULL;");
}
if ($schema->hasTable('resource_right')) {
error_log('Perform the changes in the resource_right table');
$this->addSql("ALTER TABLE resource_right CHANGE id id INT AUTO_INCREMENT NOT NULL, CHANGE resource_link_id resource_link_id INT DEFAULT NULL;");
}
if ($schema->hasTable('page')) {
error_log('Perform the changes in the page table');
$this->addSql("ALTER TABLE page CHANGE id id INT AUTO_INCREMENT NOT NULL, CHANGE category_id category_id INT DEFAULT NULL;");
}
if ($schema->hasTable('page_category')) {
error_log('Perform the changes in the page_category table');
$this->addSql("ALTER TABLE page_category CHANGE id id INT AUTO_INCREMENT NOT NULL;");
}
if ($schema->hasTable('agenda_event_invitee')) {
error_log('Perform the changes in the agenda_event_invitee table');
$this->addSql("ALTER TABLE agenda_event_invitee CHANGE id id INT AUTO_INCREMENT NOT NULL, CHANGE invitation_id invitation_id INT DEFAULT NULL;");
}
if ($schema->hasTable('branch_transaction')) {
error_log('Perform the changes in the branch_transaction table');
$this->addSql("ALTER TABLE branch_transaction CHANGE id id INT AUTO_INCREMENT NOT NULL, CHANGE transaction_id transaction_id INT NOT NULL;");
}
if ($schema->hasTable('resource_node')) {
error_log('Perform the changes in the resource_node table');
$this->addSql("ALTER TABLE resource_node CHANGE id id INT AUTO_INCREMENT NOT NULL, CHANGE resource_file_id resource_file_id INT DEFAULT NULL, CHANGE parent_id parent_id INT DEFAULT NULL;");
}
if ($schema->hasTable('resource_file')) {
error_log('Perform the changes in the resource_file table');
$this->addSql("ALTER TABLE resource_file CHANGE id id INT AUTO_INCREMENT NOT NULL;");
}
if ($schema->hasTable('resource_user_tag')) {
error_log('Perform the changes in the resource_user_tag table');
$this->addSql("ALTER TABLE resource_user_tag CHANGE id id INT AUTO_INCREMENT NOT NULL, CHANGE tag_id tag_id INT DEFAULT NULL;");
}
if ($schema->hasTable('resource_tag')) {
error_log('Perform the changes in the resource_tag table');
$this->addSql("ALTER TABLE resource_tag CHANGE id id INT AUTO_INCREMENT NOT NULL;");
}
if ($schema->hasTable('agenda_event_invitation')) {
error_log('Perform the changes in the agenda_event_invitation table');
$this->addSql("ALTER TABLE agenda_event_invitation CHANGE id id INT AUTO_INCREMENT NOT NULL;");
}
if ($schema->hasTable('gradebook_comment')) {
error_log('Perform the changes in the gradebook_comment table');
$this->addSql("ALTER TABLE gradebook_comment CHANGE id id INT AUTO_INCREMENT NOT NULL;");
}
if ($schema->hasTable('gradebook_certificate')) {
error_log('Perform the changes in the gradebook_certificate table');
$this->addSql("ALTER TABLE gradebook_certificate CHANGE id id INT AUTO_INCREMENT NOT NULL;");
}
if ($schema->hasTable('social_post')) {
error_log('Perform the changes in the social_post table');
$this->addSql("ALTER TABLE social_post CHANGE id id INT AUTO_INCREMENT NOT NULL, CHANGE parent_id parent_id INT DEFAULT NULL;");
}
if ($schema->hasTable('social_post_feedback')) {
error_log('Perform the changes in the social_post_feedback table');
$this->addSql("ALTER TABLE social_post_feedback CHANGE id id INT AUTO_INCREMENT NOT NULL, CHANGE social_post_id social_post_id INT NOT NULL;");
}
if ($schema->hasTable('branch_sync')) {
error_log('Perform the changes in the branch_sync table');
$this->addSql("ALTER TABLE branch_sync CHANGE last_sync_trans_id last_sync_trans_id INT DEFAULT NULL;");
}
if ($schema->hasTable('track_e_lastaccess')) {
error_log('Perform the changes in the track_e_lastaccess table');
$this->addSql("ALTER TABLE track_e_lastaccess CHANGE access_id access_id INT AUTO_INCREMENT NOT NULL;");
}
if ($schema->hasTable('notification')) {
error_log('Perform the changes in the notification table');
$this->addSql("ALTER TABLE notification CHANGE id id INT AUTO_INCREMENT NOT NULL;");
}
if ($schema->hasTable('message_feedback')) {
error_log('Perform the changes in the message_feedback table');
$this->addSql("ALTER TABLE message_feedback CHANGE id id INT AUTO_INCREMENT NOT NULL, CHANGE message_id message_id INT NOT NULL;");
}
if ($schema->hasTable('agenda_reminder')) {
error_log('Perform the changes in the agenda_reminder table');
$this->addSql("ALTER TABLE agenda_reminder CHANGE id id INT AUTO_INCREMENT NOT NULL;");
}
if ($schema->hasTable('c_quiz_rel_category')) {
error_log('Perform the changes in the c_quiz_rel_category table');
$this->addSql("ALTER TABLE c_quiz_rel_category CHANGE iid iid INT AUTO_INCREMENT NOT NULL;");
}
if ($schema->hasTable('c_lp_iv_interaction')) {
error_log('Perform the changes in the c_lp_iv_interaction table');
$this->addSql("ALTER TABLE c_lp_iv_interaction CHANGE lp_iv_id lp_iv_id INT NOT NULL;");
}
if ($schema->hasTable('c_lp_iv_objective')) {
error_log('Perform the changes in the c_lp_iv_objective table');
$this->addSql("ALTER TABLE c_lp_iv_objective CHANGE lp_iv_id lp_iv_id INT NOT NULL;");
}
if ($schema->hasTable('user')) {
error_log('Perform the changes in the user table');
$this->addSql("ALTER TABLE user CHANGE resource_node_id resource_node_id INT DEFAULT NULL;");
}
if ($schema->hasTable('illustration')) {
error_log('Perform the changes in the illustration table');
$this->addSql("ALTER TABLE illustration CHANGE resource_node_id resource_node_id INT DEFAULT NULL;");
}
if ($schema->hasTable('personal_file')) {
error_log('Perform the changes in the personal_file table');
$this->addSql("ALTER TABLE personal_file CHANGE resource_node_id resource_node_id INT DEFAULT NULL;");
}
if ($schema->hasTable('access_url')) {
error_log('Perform the changes in the access_url table');
$this->addSql("ALTER TABLE access_url CHANGE resource_node_id resource_node_id INT DEFAULT NULL;");
}
if ($schema->hasTable('social_post_attachments')) {
error_log('Perform the changes in the social_post_attachments table');
$this->addSql("ALTER TABLE social_post_attachments CHANGE social_post_id social_post_id INT DEFAULT NULL, CHANGE resource_node_id resource_node_id INT DEFAULT NULL;");
}
if ($schema->hasTable('message_attachment')) {
error_log('Perform the changes in the message_attachment table');
$this->addSql("ALTER TABLE message_attachment CHANGE message_id message_id INT NOT NULL, CHANGE resource_node_id resource_node_id INT DEFAULT NULL;");
}
if ($schema->hasTable('resource_comment')) {
error_log('Perform the changes in the resource_comment table');
$this->addSql("ALTER TABLE resource_comment CHANGE id id INT AUTO_INCREMENT NOT NULL, CHANGE resource_node_id resource_node_id INT DEFAULT NULL, CHANGE parent_id parent_id INT DEFAULT NULL;");
}
if ($schema->hasTable('usergroup')) {
error_log('Perform the changes in the usergroup table');
$this->addSql("ALTER TABLE usergroup CHANGE resource_node_id resource_node_id INT DEFAULT NULL;");
}
if ($schema->hasTable('course')) {
error_log('Perform the changes in the course table');
$this->addSql("ALTER TABLE course CHANGE resource_node_id resource_node_id INT DEFAULT NULL, CHANGE disk_quota disk_quota INT DEFAULT NULL;");
}
if ($schema->hasTable('ticket_message_attachments')) {
error_log('Perform the changes in the ticket_message_attachments table');
$this->addSql("ALTER TABLE ticket_message_attachments CHANGE resource_node_id resource_node_id INT DEFAULT NULL;");
}
if ($schema->hasTable('resource_link')) {
error_log('Perform the changes in the resource_link table');
$this->addSql("ALTER TABLE resource_link CHANGE id id INT AUTO_INCREMENT NOT NULL, CHANGE resource_node_id resource_node_id INT DEFAULT NULL;");
}
if ($schema->hasTable('c_student_publication_correction')) {
error_log('Perform the changes in the c_student_publication_correction table');
$this->addSql("ALTER TABLE c_student_publication_correction CHANGE resource_node_id resource_node_id INT DEFAULT NULL;");
}
if ($schema->hasTable('c_forum_attachment')) {
error_log('Perform the changes in the c_forum_attachment table');
$this->addSql("ALTER TABLE c_forum_attachment CHANGE resource_node_id resource_node_id INT DEFAULT NULL;");
}
if ($schema->hasTable('c_calendar_event')) {
error_log('Perform the changes in the c_calendar_event table');
$this->addSql("ALTER TABLE c_calendar_event CHANGE resource_node_id resource_node_id INT DEFAULT NULL;");
}
if ($schema->hasTable('c_tool')) {
error_log('Perform the changes in the c_tool table');
$this->addSql("ALTER TABLE c_tool CHANGE resource_node_id resource_node_id INT DEFAULT NULL;");
}
if ($schema->hasTable('c_glossary')) {
error_log('Perform the changes in the c_glossary table');
$this->addSql("ALTER TABLE c_glossary CHANGE resource_node_id resource_node_id INT DEFAULT NULL;");
}
if ($schema->hasTable('c_thematic')) {
error_log('Perform the changes in the c_thematic table');
$this->addSql("ALTER TABLE c_thematic CHANGE resource_node_id resource_node_id INT DEFAULT NULL;");
}
if ($schema->hasTable('c_lp_category')) {
error_log('Perform the changes in the c_lp_category table');
$this->addSql("ALTER TABLE c_lp_category CHANGE resource_node_id resource_node_id INT DEFAULT NULL;");
}
if ($schema->hasTable('c_shortcut')) {
error_log('Perform the changes in the c_shortcut table');
$this->addSql("ALTER TABLE c_shortcut CHANGE shortcut_node_id shortcut_node_id INT DEFAULT NULL, CHANGE resource_node_id resource_node_id INT DEFAULT NULL;");
}
if ($schema->hasTable('c_forum_forum')) {
error_log('Perform the changes in the c_forum_forum table');
$this->addSql("ALTER TABLE c_forum_forum CHANGE resource_node_id resource_node_id INT DEFAULT NULL;");
}
if ($schema->hasTable('c_quiz_question_category')) {
error_log('Perform the changes in the c_quiz_question_category table');
$this->addSql("ALTER TABLE c_quiz_question_category CHANGE resource_node_id resource_node_id INT DEFAULT NULL;");
}
if ($schema->hasTable('c_student_publication')) {
error_log('Perform the changes in the c_student_publication table');
$this->addSql("ALTER TABLE c_student_publication CHANGE resource_node_id resource_node_id INT DEFAULT NULL;");
}
if ($schema->hasTable('c_link')) {
error_log('Perform the changes in the c_link table');
$this->addSql("ALTER TABLE c_link CHANGE resource_node_id resource_node_id INT DEFAULT NULL;");
}
if ($schema->hasTable('c_wiki')) {
error_log('Perform the changes in the c_wiki table');
$this->addSql("ALTER TABLE c_wiki CHANGE resource_node_id resource_node_id INT DEFAULT NULL;");
}
if ($schema->hasTable('c_quiz_question')) {
error_log('Perform the changes in the c_quiz_question table');
$this->addSql("ALTER TABLE c_quiz_question CHANGE resource_node_id resource_node_id INT DEFAULT NULL;");
}
if ($schema->hasTable('c_announcement')) {
error_log('Perform the changes in the c_announcement table');
$this->addSql("ALTER TABLE c_announcement CHANGE resource_node_id resource_node_id INT DEFAULT NULL;");
}
if ($schema->hasTable('c_chat_conversation')) {
error_log('Perform the changes in the c_chat_conversation table');
$this->addSql("ALTER TABLE c_chat_conversation CHANGE resource_node_id resource_node_id INT DEFAULT NULL;");
}
if ($schema->hasTable('c_course_description')) {
error_log('Perform the changes in the c_course_description table');
$this->addSql("ALTER TABLE c_course_description CHANGE resource_node_id resource_node_id INT DEFAULT NULL;");
}
if ($schema->hasTable('c_group_category')) {
error_log('Perform the changes in the c_group_category table');
$this->addSql("ALTER TABLE c_group_category CHANGE resource_node_id resource_node_id INT DEFAULT NULL;");
}
if ($schema->hasTable('c_student_publication_comment')) {
error_log('Perform the changes in the c_student_publication_comment table');
$this->addSql("ALTER TABLE c_student_publication_comment CHANGE resource_node_id resource_node_id INT DEFAULT NULL;");
}
if ($schema->hasTable('c_quiz')) {
error_log('Perform the changes in the c_quiz table');
$this->addSql("ALTER TABLE c_quiz CHANGE exercise_category_id exercise_category_id INT DEFAULT NULL, CHANGE resource_node_id resource_node_id INT DEFAULT NULL;");
}
if ($schema->hasTable('c_forum_post')) {
error_log('Perform the changes in the c_forum_post table');
$this->addSql("ALTER TABLE c_forum_post CHANGE resource_node_id resource_node_id INT DEFAULT NULL;");
}
if ($schema->hasTable('c_attendance')) {
error_log('Perform the changes in the c_attendance table');
$this->addSql("ALTER TABLE c_attendance CHANGE resource_node_id resource_node_id INT DEFAULT NULL;");
}
if ($schema->hasTable('c_link_category')) {
error_log('Perform the changes in the c_link_category table');
$this->addSql("ALTER TABLE c_link_category CHANGE resource_node_id resource_node_id INT DEFAULT NULL;");
}
if ($schema->hasTable('c_forum_category')) {
error_log('Perform the changes in the c_forum_category table');
$this->addSql("ALTER TABLE c_forum_category CHANGE resource_node_id resource_node_id INT DEFAULT NULL;");
}
if ($schema->hasTable('c_lp')) {
error_log('Perform the changes in the c_lp table');
$this->addSql("ALTER TABLE c_lp CHANGE resource_node_id resource_node_id INT DEFAULT NULL;");
}
if ($schema->hasTable('c_document')) {
error_log('Perform the changes in the c_document table');
$this->addSql("ALTER TABLE c_document CHANGE resource_node_id resource_node_id INT DEFAULT NULL;");
}
if ($schema->hasTable('c_survey')) {
error_log('Perform the changes in the c_survey table');
$this->addSql("ALTER TABLE c_survey CHANGE resource_node_id resource_node_id INT DEFAULT NULL;");
}
if ($schema->hasTable('c_calendar_event_attachment')) {
error_log('Perform the changes in the c_calendar_event_attachment table');
$this->addSql("ALTER TABLE c_calendar_event_attachment CHANGE resource_node_id resource_node_id INT DEFAULT NULL;");
}
if ($schema->hasTable('c_announcement_attachment')) {
error_log('Perform the changes in the c_announcement_attachment table');
$this->addSql("ALTER TABLE c_announcement_attachment CHANGE resource_node_id resource_node_id INT DEFAULT NULL;");
}
if ($schema->hasTable('c_tool_intro')) {
error_log('Perform the changes in the c_tool_intro table');
$this->addSql("ALTER TABLE c_tool_intro CHANGE resource_node_id resource_node_id INT DEFAULT NULL;");
}
if ($schema->hasTable('c_forum_thread')) {
error_log('Perform the changes in the c_forum_thread table');
$this->addSql("ALTER TABLE c_forum_thread CHANGE resource_node_id resource_node_id INT DEFAULT NULL;");
}
if ($schema->hasTable('c_group_info')) {
error_log('Perform the changes in the c_group_info table');
$this->addSql("ALTER TABLE c_group_info CHANGE resource_node_id resource_node_id INT DEFAULT NULL;");
}
if ($schema->hasTable('c_notebook')) {
error_log('Perform the changes in the c_notebook table');
$this->addSql("ALTER TABLE c_notebook CHANGE resource_node_id resource_node_id INT DEFAULT NULL;");
}
if ($schema->hasTable('c_exercise_category')) {
error_log('Perform the changes in the c_exercise_category table');
$this->addSql("ALTER TABLE c_exercise_category CHANGE id id INT AUTO_INCREMENT NOT NULL, CHANGE resource_node_id resource_node_id INT DEFAULT NULL;");
}
if ($schema->hasTable('lti_external_tool')) {
error_log('Perform the changes in the lti_external_tool table');
$this->addSql("ALTER TABLE lti_external_tool CHANGE resource_node_id resource_node_id INT DEFAULT NULL;");
}
if ($schema->hasTable('message')) {
error_log('Perform the changes in the message table');
$this->addSql("ALTER TABLE message CHANGE id id INT AUTO_INCREMENT NOT NULL, CHANGE parent_id parent_id INT DEFAULT NULL;");
}
if ($schema->hasTable('message_rel_user')) {
error_log('Perform the changes in the message_rel_user table');
$this->addSql("ALTER TABLE message_rel_user CHANGE id id INT AUTO_INCREMENT NOT NULL, CHANGE message_id message_id INT NOT NULL;");
}
if ($schema->hasTable('message_rel_user_rel_tags')) {
error_log('Perform the changes in the message_rel_user_rel_tags table');
$this->addSql("ALTER TABLE message_rel_user_rel_tags CHANGE message_rel_user_id message_rel_user_id INT NOT NULL, CHANGE message_tag_id message_tag_id INT NOT NULL;");
}
if ($schema->hasTable('message_tag')) {
error_log('Perform the changes in the message_tag table');
$this->addSql("ALTER TABLE message_tag CHANGE id id INT AUTO_INCREMENT NOT NULL;");
}
// Re-enable foreign key and unique checks to ensure database integrity
$this->addSql('SET UNIQUE_CHECKS=1;');
$this->addSql('SET FOREIGN_KEY_CHECKS=1;');
}
}

@ -22,7 +22,7 @@ class CExerciseCategory extends AbstractResource implements ResourceInterface, S
{
use TimestampableEntity;
#[ORM\Column(name: 'id', type: 'bigint')]
#[ORM\Column(name: 'id', type: 'integer')]
#[ORM\Id]
#[ORM\GeneratedValue]
protected ?int $id = null;

@ -28,7 +28,7 @@ class CLpIvInteraction
#[ORM\Column(name: 'order_id', type: 'integer', nullable: false)]
protected int $orderId;
#[ORM\Column(name: 'lp_iv_id', type: 'bigint', nullable: false)]
#[ORM\Column(name: 'lp_iv_id', type: 'integer', nullable: false)]
protected int $lpIvId;
#[ORM\Column(name: 'interaction_id', type: 'string', length: 255, nullable: false)]

@ -25,7 +25,7 @@ class CLpIvObjective
#[ORM\Column(name: 'c_id', type: 'integer')]
protected int $cId;
#[ORM\Column(name: 'lp_iv_id', type: 'bigint', nullable: false)]
#[ORM\Column(name: 'lp_iv_id', type: 'integer', nullable: false)]
protected int $lpIvId;
#[ORM\Column(name: 'order_id', type: 'integer', nullable: false)]

@ -15,7 +15,7 @@ use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity]
class CQuizRelQuestionCategory
{
#[ORM\Column(name: 'iid', type: 'bigint')]
#[ORM\Column(name: 'iid', type: 'integer')]
#[ORM\Id]
#[ORM\GeneratedValue]
protected ?int $iid = null;

Loading…
Cancel
Save