Fix table creation "course_rel_user_catalogue" #2120

pull/2487/head
jmontoyaa 7 years ago
parent cd4fcd1cfc
commit db9cddab76
  1. 4
      app/Migrations/Schema/V111/Version111.php
  2. 8
      app/Migrations/Schema/V111/Version20160706182000.php

@ -500,6 +500,10 @@ class Version111 extends AbstractMigrationChamilo
}
}
$this->addSql(
'CREATE TABLE IF NOT EXISTS course_rel_user_catalogue (id int NOT NULL AUTO_INCREMENT, user_id int DEFAULT NULL, c_id int DEFAULT NULL, visible int NOT NULL, PRIMARY KEY (id), KEY (user_id), KEY (c_id), CONSTRAINT FOREIGN KEY (c_id) REFERENCES course (id) ON DELETE CASCADE, CONSTRAINT FOREIGN KEY (user_id) REFERENCES user (id) ON DELETE CASCADE) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci'
);
if ($schema->hasTable('course_rel_user_catalogue')) {
$table = $schema->getTable('course_rel_user_catalogue');

@ -23,7 +23,7 @@ class Version20160706182000 extends AbstractMigrationChamilo
public function up(Schema $schema)
{
$this->addSql(
'CREATE TABLE course_rel_user_catalogue (id int NOT NULL AUTO_INCREMENT, user_id int DEFAULT NULL, c_id int DEFAULT NULL, visible int NOT NULL, PRIMARY KEY (id), KEY (user_id), KEY (c_id), CONSTRAINT FOREIGN KEY (c_id) REFERENCES course (id) ON DELETE CASCADE, CONSTRAINT FOREIGN KEY (user_id) REFERENCES user (id) ON DELETE CASCADE) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci'
'CREATE TABLE IF NOT EXISTS course_rel_user_catalogue (id int NOT NULL AUTO_INCREMENT, user_id int DEFAULT NULL, c_id int DEFAULT NULL, visible int NOT NULL, PRIMARY KEY (id), KEY (user_id), KEY (c_id), CONSTRAINT FOREIGN KEY (c_id) REFERENCES course (id) ON DELETE CASCADE, CONSTRAINT FOREIGN KEY (user_id) REFERENCES user (id) ON DELETE CASCADE) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci'
);
}
@ -36,7 +36,7 @@ class Version20160706182000 extends AbstractMigrationChamilo
public function down(Schema $schema)
{
$this->addSql(
'DROP TABLE course_rel_user_catalogue'
);
'DROP TABLE course_rel_user_catalogue'
);
}
}
}

Loading…
Cancel
Save