migrations/Version20221019211520.php line 1

  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 Version20221019211520 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 item_document_indicator (id INT AUTO_INCREMENT NOT NULL, user_created INT DEFAULT NULL, user_changed INT DEFAULT NULL, item_indicator INT DEFAULT NULL, item_document INT DEFAULT NULL, date_created DATETIME DEFAULT NULL, date_changed DATETIME DEFAULT NULL, active TINYINT(1) DEFAULT 1 NOT NULL, value NUMERIC(20, 2) DEFAULT NULL, INDEX IDX_975FD254EA30A9B2 (user_created), INDEX IDX_975FD254FBFE23F0 (user_changed), INDEX IDX_975FD254DDEE8B43 (item_indicator), INDEX IDX_975FD254B46442BD (item_document), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  19.         $this->addSql('ALTER TABLE item_document_indicator ADD CONSTRAINT FK_975FD254EA30A9B2 FOREIGN KEY (user_created) REFERENCES user (id)');
  20.         $this->addSql('ALTER TABLE item_document_indicator ADD CONSTRAINT FK_975FD254FBFE23F0 FOREIGN KEY (user_changed) REFERENCES user (id)');
  21.         $this->addSql('ALTER TABLE item_document_indicator ADD CONSTRAINT FK_975FD254DDEE8B43 FOREIGN KEY (item_indicator) REFERENCES item_indicator (id)');
  22.         $this->addSql('ALTER TABLE item_document_indicator ADD CONSTRAINT FK_975FD254B46442BD FOREIGN KEY (item_document) REFERENCES item_document (id)');
  23.     }
  24.     public function down(Schema $schema): void
  25.     {
  26.         // this down() migration is auto-generated, please modify it to your needs
  27.         $this->addSql('ALTER TABLE item_document_indicator DROP FOREIGN KEY FK_975FD254EA30A9B2');
  28.         $this->addSql('ALTER TABLE item_document_indicator DROP FOREIGN KEY FK_975FD254FBFE23F0');
  29.         $this->addSql('ALTER TABLE item_document_indicator DROP FOREIGN KEY FK_975FD254DDEE8B43');
  30.         $this->addSql('ALTER TABLE item_document_indicator DROP FOREIGN KEY FK_975FD254B46442BD');
  31.         $this->addSql('DROP TABLE item_document_indicator');
  32.     }
  33. }