migrations/Version20221129075905.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 Version20221129075905 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('ALTER TABLE job ADD removed_by_id INT DEFAULT NULL');
  19.         $this->addSql('ALTER TABLE job ADD removed_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL');
  20.         $this->addSql('COMMENT ON COLUMN job.removed_at IS \'Когда удалено\'');
  21.         $this->addSql('ALTER TABLE job ADD CONSTRAINT FK_FBD8E0F82BD701DA FOREIGN KEY (removed_by_id) REFERENCES "user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
  22.         $this->addSql('CREATE INDEX IDX_FBD8E0F82BD701DA ON job (removed_by_id)');
  23.         $this->addSql('ALTER TABLE organization_section ADD removed_by_id INT DEFAULT NULL');
  24.         $this->addSql('ALTER TABLE organization_section ADD removed_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL');
  25.         $this->addSql('COMMENT ON COLUMN organization_section.removed_at IS \'Когда удалено\'');
  26.         $this->addSql('ALTER TABLE organization_section ADD CONSTRAINT FK_E0A1F2AC2BD701DA FOREIGN KEY (removed_by_id) REFERENCES "user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
  27.         $this->addSql('CREATE INDEX IDX_E0A1F2AC2BD701DA ON organization_section (removed_by_id)');
  28.         $this->addSql('ALTER TABLE sport_object_section ADD removed_by_id INT DEFAULT NULL');
  29.         $this->addSql('ALTER TABLE sport_object_section ADD removed_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL');
  30.         $this->addSql('COMMENT ON COLUMN sport_object_section.removed_at IS \'Когда удалено\'');
  31.         $this->addSql('ALTER TABLE sport_object_section ADD CONSTRAINT FK_9B8C457C2BD701DA FOREIGN KEY (removed_by_id) REFERENCES "user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
  32.         $this->addSql('CREATE INDEX IDX_9B8C457C2BD701DA ON sport_object_section (removed_by_id)');
  33.     }
  34.     public function down(Schema $schema): void
  35.     {
  36.         // this down() migration is auto-generated, please modify it to your needs
  37.         $this->addSql('ALTER TABLE organization_section DROP CONSTRAINT FK_E0A1F2AC2BD701DA');
  38.         $this->addSql('DROP INDEX IDX_E0A1F2AC2BD701DA');
  39.         $this->addSql('ALTER TABLE organization_section DROP removed_by_id');
  40.         $this->addSql('ALTER TABLE organization_section DROP removed_at');
  41.         $this->addSql('ALTER TABLE sport_object_section DROP CONSTRAINT FK_9B8C457C2BD701DA');
  42.         $this->addSql('DROP INDEX IDX_9B8C457C2BD701DA');
  43.         $this->addSql('ALTER TABLE sport_object_section DROP removed_by_id');
  44.         $this->addSql('ALTER TABLE sport_object_section DROP removed_at');
  45.         $this->addSql('ALTER TABLE job DROP CONSTRAINT FK_FBD8E0F82BD701DA');
  46.         $this->addSql('DROP INDEX IDX_FBD8E0F82BD701DA');
  47.         $this->addSql('ALTER TABLE job DROP removed_by_id');
  48.         $this->addSql('ALTER TABLE job DROP removed_at');
  49.     }
  50. }