skipIf($this->legacyCheck($schema, 'Framadate\Migration\AddColumn_uniqId_In_vote_For_0_9'), 'Migration has been executed in an earlier database migration system'); foreach ([Utils::table('poll'), Utils::table('slot'), Utils::table('vote'), Utils::table('comment')] as $table) { $this->skipIf(!$schema->hasTable($table), 'Missing table ' . $table); } $voteTable = $schema->getTable(Utils::table('vote')); $this->skipIf($voteTable->hasColumn('uniqId'), 'Column uniqId already existing'); $voteTable->addColumn('uniqId', 'string', ['length' => 16]); $voteTable->addIndex(['uniqId'], $this->indexUniqIdName); } /** * @param Schema $schema * @throws \Doctrine\DBAL\Schema\SchemaException */ public function down(Schema $schema) { $voteTable = $schema->getTable(Utils::table('vote')); $voteTable->dropIndex($this->indexUniqIdName); $voteTable->dropColumn('uniqId'); } }