adding hasColumn conditions see BT#8200

1.10.x
Julio 9 years ago
parent 12d243269e
commit 30648a5154
  1. 11
      app/Migrations/Schema/V110/Version20150603181728.php

@ -28,7 +28,16 @@ class Version20150603181728 extends AbstractMigrationChamilo
*/
public function up(Schema $schema)
{
$this->addSql('ALTER TABLE c_lp ADD max_attempts INT NOT NULL, ADD subscribe_users INT NOT NULL DEFAULT 0');
$table = $schema->getTable('c_lp');
if (!$table->hasColumn('max_attempts')) {
$this->addSql('ALTER TABLE c_lp ADD max_attempts INT NOT NULL');
}
if (!$table->hasColumn('subscribe_users')) {
$this->addSql('ALTER TABLE c_lp ADD subscribe_users INT NOT NULL DEFAULT 0');
}
$this->addSql('
ALTER TABLE c_item_property
MODIFY c_id INT DEFAULT NULL,

Loading…
Cancel
Save