migrations/Version20200309135534.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. /**
  7.  * Auto-generated Migration: Please modify to your needs!
  8.  */
  9. final class Version20200309135534 extends AbstractMigration
  10. {
  11.     public function getDescription() : string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema) : void
  16.     {
  17.         // this up() migration is auto-generated, please modify it to your needs
  18.         $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql''Migration can only be executed safely on \'mysql\'.');
  19.         $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');
  20.         $this->addSql('ALTER TABLE voucher_purchase ADD CONSTRAINT FK_FFB089B2DE12AB56 FOREIGN KEY (created_by) REFERENCES fos_user (id)');
  21.         $this->addSql('ALTER TABLE voucher_purchase ADD CONSTRAINT FK_FFB089B216FE72E1 FOREIGN KEY (updated_by) REFERENCES fos_user (id)');
  22.         $this->addSql('CREATE INDEX IDX_FFB089B2DE12AB56 ON voucher_purchase (created_by)');
  23.         $this->addSql('CREATE INDEX IDX_FFB089B216FE72E1 ON voucher_purchase (updated_by)');
  24.         $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');
  25.         $this->addSql('ALTER TABLE voucher_store ADD CONSTRAINT FK_3AEC0E49DE12AB56 FOREIGN KEY (created_by) REFERENCES fos_user (id)');
  26.         $this->addSql('ALTER TABLE voucher_store ADD CONSTRAINT FK_3AEC0E4916FE72E1 FOREIGN KEY (updated_by) REFERENCES fos_user (id)');
  27.         $this->addSql('CREATE INDEX IDX_3AEC0E49DE12AB56 ON voucher_store (created_by)');
  28.         $this->addSql('CREATE INDEX IDX_3AEC0E4916FE72E1 ON voucher_store (updated_by)');
  29.     }
  30.     public function down(Schema $schema) : void
  31.     {
  32.         // this down() migration is auto-generated, please modify it to your needs
  33.         $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql''Migration can only be executed safely on \'mysql\'.');
  34.         $this->addSql('ALTER TABLE voucher_purchase DROP FOREIGN KEY FK_FFB089B2DE12AB56');
  35.         $this->addSql('ALTER TABLE voucher_purchase DROP FOREIGN KEY FK_FFB089B216FE72E1');
  36.         $this->addSql('DROP INDEX IDX_FFB089B2DE12AB56 ON voucher_purchase');
  37.         $this->addSql('DROP INDEX IDX_FFB089B216FE72E1 ON voucher_purchase');
  38.         $this->addSql('ALTER TABLE voucher_purchase DROP created_by, DROP updated_by, DROP created_at, DROP updated_at');
  39.         $this->addSql('ALTER TABLE voucher_store DROP FOREIGN KEY FK_3AEC0E49DE12AB56');
  40.         $this->addSql('ALTER TABLE voucher_store DROP FOREIGN KEY FK_3AEC0E4916FE72E1');
  41.         $this->addSql('DROP INDEX IDX_3AEC0E49DE12AB56 ON voucher_store');
  42.         $this->addSql('DROP INDEX IDX_3AEC0E4916FE72E1 ON voucher_store');
  43.         $this->addSql('ALTER TABLE voucher_store DROP created_by, DROP updated_by, DROP created_at, DROP updated_at, DROP name');
  44.     }
  45. }