for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20191213225240 extends AbstractMigration
{
public function getDescription(): string
return 'Make subtype names unique';
}
public function up(Schema $schema): void
$this->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('CREATE UNIQUE INDEX UNIQ_B5759A895E237E06 ON salt_association_subtype (name)');
public function down(Schema $schema): void
$this->addSql('DROP INDEX UNIQ_B5759A895E237E06 ON salt_association_subtype');