<?php declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20191204062616 extends AbstractMigration
{
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
// delete existing data
$this->addSql("DELETE FROM abonnenttoken");
$this->addSql("DELETE FROM abonnent");
$this->addSql('ALTER TABLE abonnenttoken DROP FOREIGN KEY FK_CAFF3B53F85E0677');
$this->addSql('DROP INDEX IDX_CAFF3B53F85E0677 ON abonnenttoken');
$this->addSql('ALTER TABLE abonnent DROP PRIMARY KEY');
$this->addSql('ALTER TABLE abonnent ADD id INT NOT NULL, DROP password');
$this->addSql('ALTER TABLE abonnent ADD PRIMARY KEY (id)');
$this->addSql('ALTER TABLE abonnenttoken ADD abonnent_id INT DEFAULT NULL, DROP username');
$this->addSql('ALTER TABLE abonnenttoken ADD CONSTRAINT FK_CAFF3B53B19B9B31 FOREIGN KEY (abonnent_id) REFERENCES abonnent (id)');
$this->addSql('CREATE INDEX IDX_CAFF3B53B19B9B31 ON abonnenttoken (abonnent_id)');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
}
}