connection->getDatabasePlatform(); switch (true) { case $platform instanceof SqlitePlatform: $annotationTableName = $this->getTable('annotation', true); $userTableName = $this->getTable('user', true); $entryTableName = $this->getTable('entry', true); $this->addSql(<<addSql('DROP TABLE ' . $annotationTableName); $this->addSql(<<addSql(<<addSql('DROP TABLE __temp__wallabag_annotation'); break; case $platform instanceof MySQLPlatform: $this->addSql('ALTER TABLE ' . $this->getTable('annotation') . ' MODIFY quote TEXT NOT NULL'); break; case $platform instanceof PostgreSQLPlatform: $this->addSql('ALTER TABLE ' . $this->getTable('annotation') . ' ALTER COLUMN quote TYPE TEXT'); break; } } public function down(Schema $schema): void { $tableName = $this->getTable('annotation'); $platform = $this->connection->getDatabasePlatform(); switch (true) { case $platform instanceof SqlitePlatform: throw new SkipMigration('Too complex ...'); break; case $platform instanceof MySQLPlatform: $this->addSql('ALTER TABLE ' . $tableName . ' MODIFY quote VARCHAR(255) NOT NULL'); break; case $platform instanceof PostgreSQLPlatform: $this->addSql('ALTER TABLE ' . $tableName . ' ALTER COLUMN quote TYPE VARCHAR(255)'); break; } } }