for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Application\Migration;
use Doctrine\DBAL\Schema\Schema;
class Version20190125050436 extends AbstractMigration
{
public function up(Schema $schema): void
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('UPDATE account JOIN user ON user.account_id = account.id SET account.owner_id = user.id');
$this->addSql('ALTER TABLE account DROP INDEX IDX_7D3656A47E3C61F9, ADD UNIQUE INDEX UNIQ_7D3656A47E3C61F9 (owner_id)');
$this->addSql('ALTER TABLE user DROP FOREIGN KEY FK_8D93D6499B6B5FBA');
$this->addSql('DROP INDEX UNIQ_8D93D6499B6B5FBA ON user');
$this->addSql('ALTER TABLE user DROP account_id');
}