<?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 Version20200309135534 extends AbstractMigration
{
public function getDescription() : string
{
return '';
}
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\'.');
$this->addSql('ALTER TABLE voucher_purchase ADD created_by INT DEFAULT NULL, ADD updated_by INT DEFAULT NULL, ADD created_at DATETIME NOT NULL, ADD updated_at DATETIME NOT NULL');
$this->addSql('ALTER TABLE voucher_purchase ADD CONSTRAINT FK_FFB089B2DE12AB56 FOREIGN KEY (created_by) REFERENCES fos_user (id)');
$this->addSql('ALTER TABLE voucher_purchase ADD CONSTRAINT FK_FFB089B216FE72E1 FOREIGN KEY (updated_by) REFERENCES fos_user (id)');
$this->addSql('CREATE INDEX IDX_FFB089B2DE12AB56 ON voucher_purchase (created_by)');
$this->addSql('CREATE INDEX IDX_FFB089B216FE72E1 ON voucher_purchase (updated_by)');
$this->addSql('ALTER TABLE voucher_store ADD created_by INT DEFAULT NULL, ADD updated_by INT DEFAULT NULL, ADD created_at DATETIME NOT NULL, ADD updated_at DATETIME NOT NULL, ADD name VARCHAR(255) NOT NULL');
$this->addSql('ALTER TABLE voucher_store ADD CONSTRAINT FK_3AEC0E49DE12AB56 FOREIGN KEY (created_by) REFERENCES fos_user (id)');
$this->addSql('ALTER TABLE voucher_store ADD CONSTRAINT FK_3AEC0E4916FE72E1 FOREIGN KEY (updated_by) REFERENCES fos_user (id)');
$this->addSql('CREATE INDEX IDX_3AEC0E49DE12AB56 ON voucher_store (created_by)');
$this->addSql('CREATE INDEX IDX_3AEC0E4916FE72E1 ON voucher_store (updated_by)');
}
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\'.');
$this->addSql('ALTER TABLE voucher_purchase DROP FOREIGN KEY FK_FFB089B2DE12AB56');
$this->addSql('ALTER TABLE voucher_purchase DROP FOREIGN KEY FK_FFB089B216FE72E1');
$this->addSql('DROP INDEX IDX_FFB089B2DE12AB56 ON voucher_purchase');
$this->addSql('DROP INDEX IDX_FFB089B216FE72E1 ON voucher_purchase');
$this->addSql('ALTER TABLE voucher_purchase DROP created_by, DROP updated_by, DROP created_at, DROP updated_at');
$this->addSql('ALTER TABLE voucher_store DROP FOREIGN KEY FK_3AEC0E49DE12AB56');
$this->addSql('ALTER TABLE voucher_store DROP FOREIGN KEY FK_3AEC0E4916FE72E1');
$this->addSql('DROP INDEX IDX_3AEC0E49DE12AB56 ON voucher_store');
$this->addSql('DROP INDEX IDX_3AEC0E4916FE72E1 ON voucher_store');
$this->addSql('ALTER TABLE voucher_store DROP created_by, DROP updated_by, DROP created_at, DROP updated_at, DROP name');
}
}