migrations/Version20221229121201.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 Version20221229121201 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->addSql('CREATE TABLE warehouse_admission_attachment (id INT AUTO_INCREMENT NOT NULL, warehouse_admission_id INT NOT NULL, created_by_id INT DEFAULT NULL, file_name VARCHAR(255) NOT NULL, file_path VARCHAR(255) NOT NULL, created_at DATETIME NOT NULL, INDEX IDX_BF9079355547906 (warehouse_admission_id), INDEX IDX_BF90793B03A8386 (created_by_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB');
  19.         $this->addSql('ALTER TABLE warehouse_admission_attachment ADD CONSTRAINT FK_BF9079355547906 FOREIGN KEY (warehouse_admission_id) REFERENCES warehouse_admission (id)');
  20.         $this->addSql('ALTER TABLE warehouse_admission_attachment ADD CONSTRAINT FK_BF90793B03A8386 FOREIGN KEY (created_by_id) REFERENCES `user` (id)');
  21.         $this->addSql('ALTER TABLE diet_translation ADD internal_name VARCHAR(255) DEFAULT NULL');
  22.         $this->addSql('ALTER TABLE ingredient_translation ADD internal_name VARCHAR(255) DEFAULT NULL');
  23.         $this->addSql('ALTER TABLE warehouse ADD type VARCHAR(32) DEFAULT NULL');
  24.         $this->addSql('ALTER TABLE warehouse_admission ADD note LONGTEXT DEFAULT NULL');
  25.         $this->addSql('ALTER TABLE warehouse_release ADD note LONGTEXT DEFAULT NULL, ADD type VARCHAR(32) DEFAULT NULL');
  26.     }
  27.     public function down(Schema $schema): void
  28.     {
  29.         // this down() migration is auto-generated, please modify it to your needs
  30.         $this->addSql('DROP TABLE warehouse_admission_attachment');
  31.         $this->addSql('ALTER TABLE diet_translation DROP internal_name');
  32.         $this->addSql('ALTER TABLE ingredient_translation DROP internal_name');
  33.         $this->addSql('ALTER TABLE warehouse DROP type');
  34.         $this->addSql('ALTER TABLE warehouse_admission DROP note');
  35.         $this->addSql('ALTER TABLE warehouse_release DROP note, DROP type');
  36.     }
  37. }