addSql('ALTER TABLE language MODIFY id INT'); $this->addSql('ALTER TABLE language MODIFY parent_id INT'); $this->addSql('ALTER TABLE language ADD CONSTRAINT language_parent FOREIGN KEY (parent_id) REFERENCES language (id)'); } /** * @param Schema $schema * @throws \Doctrine\DBAL\DBALException * @throws \Doctrine\DBAL\Schema\SchemaException */ public function down(Schema $schema) { $languageTable = $schema->getTable('language'); $languageTable->removeForeignKey('language_parent'); $languageTable ->getColumn('parent_id') ->setType(Type::getType(Type::BOOLEAN)) ->setNotnull(false); } }