migrations/Version20170529145419.php line 1

Open in your IDE?
  1. <?php
  2. namespace DoctrineMigrations;
  3. use Doctrine\DBAL\Schema\Schema;
  4. use Doctrine\Migrations\AbstractMigration;
  5. /**
  6.  * Auto-generated Migration: Please modify to your needs!
  7.  */
  8. class Version20170529145419 extends AbstractMigration
  9. {
  10.     public function up(Schema $schema): void
  11.     {
  12.         // this up() migration is auto-generated, please modify it to your needs
  13.         $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql''Migration can only be executed safely on \'mysql\'.');
  14.         $this->addSql('ALTER TABLE estimate_stock DROP FOREIGN KEY FK_3C7767AFDCD6110');
  15.         $this->addSql('DROP INDEX IDX_3C7767AFDCD6110 ON estimate_stock');
  16.         $this->addSql('ALTER TABLE estimate_stock CHANGE stock_id supplierStock_id INT DEFAULT NULL');
  17.         $this->addSql('ALTER TABLE estimate_stock ADD CONSTRAINT FK_3C7767AF1969624 FOREIGN KEY (supplierStock_id) REFERENCES supplier_stock (id)');
  18.         $this->addSql('CREATE INDEX IDX_3C7767AF1969624 ON estimate_stock (supplierStock_id)');
  19.         $this->addSql('ALTER TABLE stock DROP stock_quantity');
  20.     }
  21.     public function down(Schema $schema): void
  22.     {
  23.         // this down() migration is auto-generated, please modify it to your needs
  24.         $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql''Migration can only be executed safely on \'mysql\'.');
  25.         $this->addSql('ALTER TABLE estimate_stock DROP FOREIGN KEY FK_3C7767AF1969624');
  26.         $this->addSql('DROP INDEX IDX_3C7767AF1969624 ON estimate_stock');
  27.         $this->addSql('ALTER TABLE estimate_stock CHANGE supplierstock_id stock_id INT DEFAULT NULL');
  28.         $this->addSql('ALTER TABLE estimate_stock ADD CONSTRAINT FK_3C7767AFDCD6110 FOREIGN KEY (stock_id) REFERENCES stock (id)');
  29.         $this->addSql('CREATE INDEX IDX_3C7767AFDCD6110 ON estimate_stock (stock_id)');
  30.         $this->addSql('ALTER TABLE stock ADD stock_quantity INT NOT NULL');
  31.     }
  32. }