migrations/Version20221128164526.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 Version20221128164526 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 property_visit_voucher DROP CONSTRAINT fk_57634dbf78eab0e7');
  19.         $this->addSql('ALTER TABLE property_visit_voucher DROP CONSTRAINT fk_57634dbf6c51c821');
  20.         $this->addSql('DROP INDEX idx_57634dbf78eab0e7');
  21.         $this->addSql('DROP INDEX idx_57634dbf6c51c821');
  22.         $this->addSql('ALTER TABLE property_visit_voucher DROP reference_property_contract_type_id');
  23.         $this->addSql('ALTER TABLE property_visit_voucher DROP reference_property_land_type_id');
  24.     }
  25.     public function down(Schema $schema): void
  26.     {
  27.         // this down() migration is auto-generated, please modify it to your needs
  28.         $this->addSql('CREATE SCHEMA public');
  29.         $this->addSql('ALTER TABLE property_visit_voucher ADD reference_property_contract_type_id INT DEFAULT NULL');
  30.         $this->addSql('ALTER TABLE property_visit_voucher ADD reference_property_land_type_id INT DEFAULT NULL');
  31.         $this->addSql('ALTER TABLE property_visit_voucher ADD CONSTRAINT fk_57634dbf78eab0e7 FOREIGN KEY (reference_property_contract_type_id) REFERENCES reference_property_contract_type (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
  32.         $this->addSql('ALTER TABLE property_visit_voucher ADD CONSTRAINT fk_57634dbf6c51c821 FOREIGN KEY (reference_property_land_type_id) REFERENCES reference_property_land_type (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
  33.         $this->addSql('CREATE INDEX idx_57634dbf78eab0e7 ON property_visit_voucher (reference_property_contract_type_id)');
  34.         $this->addSql('CREATE INDEX idx_57634dbf6c51c821 ON property_visit_voucher (reference_property_land_type_id)');
  35.     }
  36. }