migrations/Version20220916162017.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 Version20220916162017 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 agent ADD nationality_id INT DEFAULT NULL');
  19.         $this->addSql('ALTER TABLE agent ADD cnss VARCHAR(100) DEFAULT NULL');
  20.         $this->addSql('ALTER TABLE agent ADD rc VARCHAR(100) DEFAULT NULL');
  21.         $this->addSql('ALTER TABLE agent ADD professional_status VARCHAR(100) DEFAULT NULL');
  22.         $this->addSql('ALTER TABLE agent ADD subject_to_vat BOOLEAN DEFAULT NULL');
  23.         $this->addSql('ALTER TABLE agent ADD CONSTRAINT FK_268B9C9D1C9DA55 FOREIGN KEY (nationality_id) REFERENCES nationality (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
  24.         $this->addSql('CREATE INDEX IDX_268B9C9D1C9DA55 ON agent (nationality_id)');
  25.         }
  26.     public function down(Schema $schema): void
  27.     {
  28.         // this down() migration is auto-generated, please modify it to your needs
  29.         $this->addSql('CREATE SCHEMA public');
  30.         $this->addSql('ALTER TABLE agent DROP CONSTRAINT FK_268B9C9D1C9DA55');
  31.         $this->addSql('DROP INDEX IDX_268B9C9D1C9DA55');
  32.         $this->addSql('ALTER TABLE agent DROP nationality_id');
  33.         $this->addSql('ALTER TABLE agent DROP cnss');
  34.         $this->addSql('ALTER TABLE agent DROP rc');
  35.         $this->addSql('ALTER TABLE agent DROP professional_status');
  36.         $this->addSql('ALTER TABLE agent DROP subject_to_vat');
  37.     }
  38. }