Internal: Migration: fix constraint creation on message due to difference between field types for id and parent_id -refs BT#20864

pull/5099/head
NicoDucou 2 years ago
parent 1792ba2029
commit 5dfbd0b2e8
  1. 2
      src/CoreBundle/Migrations/Schema/V200/Version20200821224242.php

@ -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 INT DEFAULT NULL');
$this->addSql('ALTER TABLE message CHANGE id id INT AUTO_INCREMENT NOT NULL, 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');

Loading…
Cancel
Save