migrations/Version20230411161345.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 Version20230411161345 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 candidate_research ADD diaspora TINYINT(1) NOT NULL, ADD address_diaspora VARCHAR(255) DEFAULT NULL');
  19.         $this->addSql('ALTER TABLE company_creator ADD diaspora TINYINT(1) NOT NULL, ADD address_diaspora VARCHAR(255) DEFAULT NULL');
  20.         $this->addSql('ALTER TABLE geo_location ADD show_other_person_degrees TINYINT(1) NOT NULL, CHANGE show_person_degrees show_search_person_degrees TINYINT(1) NOT NULL');
  21.         $this->addSql('ALTER TABLE person_degree ADD residence_country_id INT DEFAULT NULL, ADD diaspora TINYINT(1) NOT NULL, ADD address_diaspora VARCHAR(255) DEFAULT NULL');
  22.         $this->addSql('ALTER TABLE person_degree ADD CONSTRAINT FK_3B065DD547C609EB FOREIGN KEY (residence_country_id) REFERENCES country (id)');
  23.         $this->addSql('CREATE INDEX IDX_3B065DD547C609EB ON person_degree (residence_country_id)');
  24.         $this->addSql('ALTER TABLE user_role DROP FOREIGN KEY FK_2DE8C6A3A76ED395');
  25.         $this->addSql('ALTER TABLE user_role DROP FOREIGN KEY FK_2DE8C6A3D60322AC');
  26.         $this->addSql('ALTER TABLE user_role ADD CONSTRAINT FK_2DE8C6A3A76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
  27.         $this->addSql('ALTER TABLE user_role ADD CONSTRAINT FK_2DE8C6A3D60322AC FOREIGN KEY (role_id) REFERENCES role (id)');
  28.     }
  29.     public function down(Schema $schema): void
  30.     {
  31.         // this down() migration is auto-generated, please modify it to your needs
  32.         $this->addSql('ALTER TABLE candidate_research DROP diaspora, DROP address_diaspora');
  33.         $this->addSql('ALTER TABLE company_creator DROP diaspora, DROP address_diaspora');
  34.         $this->addSql('ALTER TABLE geo_location ADD show_person_degrees TINYINT(1) NOT NULL, DROP show_search_person_degrees, DROP show_other_person_degrees');
  35.         $this->addSql('ALTER TABLE person_degree DROP FOREIGN KEY FK_3B065DD547C609EB');
  36.         $this->addSql('DROP INDEX IDX_3B065DD547C609EB ON person_degree');
  37.         $this->addSql('ALTER TABLE person_degree DROP residence_country_id, DROP diaspora, DROP address_diaspora');
  38.         $this->addSql('ALTER TABLE user_role DROP FOREIGN KEY FK_2DE8C6A3A76ED395');
  39.         $this->addSql('ALTER TABLE user_role DROP FOREIGN KEY FK_2DE8C6A3D60322AC');
  40.         $this->addSql('ALTER TABLE user_role ADD CONSTRAINT FK_2DE8C6A3A76ED395 FOREIGN KEY (user_id) REFERENCES user (id) ON UPDATE CASCADE ON DELETE CASCADE');
  41.         $this->addSql('ALTER TABLE user_role ADD CONSTRAINT FK_2DE8C6A3D60322AC FOREIGN KEY (role_id) REFERENCES role (id) ON UPDATE CASCADE ON DELETE CASCADE');
  42.     }
  43. }