migrations/Version20211127142335.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 Version20211127142335 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 domain CHANGE is_enabled is_enabled TINYINT(1) NOT NULL');
  19.         $this->addSql('ALTER TABLE git_depot DROP FOREIGN KEY FK_75E671E8A76ED395');
  20.         $this->addSql('DROP INDEX IDX_75E671E8A76ED395 ON git_depot');
  21.         $this->addSql('ALTER TABLE git_depot DROP user_id');
  22.         $this->addSql('ALTER TABLE organisation CHANGE is_added is_added TINYINT(1) NOT NULL');
  23.         $this->addSql('ALTER TABLE subscription ADD organisation_id INT NOT NULL');
  24.         $this->addSql('ALTER TABLE subscription ADD CONSTRAINT FK_A3C664D39E6B1585 FOREIGN KEY (organisation_id) REFERENCES organisation (id)');
  25.         $this->addSql('CREATE INDEX IDX_A3C664D39E6B1585 ON subscription (organisation_id)');
  26.     }
  27.     public function down(Schema $schema): void
  28.     {
  29.         // this down() migration is auto-generated, please modify it to your needs
  30.         $this->addSql('ALTER TABLE domain CHANGE is_enabled is_enabled TINYINT(1) DEFAULT \'0\' NOT NULL');
  31.         $this->addSql('ALTER TABLE git_depot ADD user_id INT NOT NULL');
  32.         $this->addSql('ALTER TABLE git_depot ADD CONSTRAINT FK_75E671E8A76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
  33.         $this->addSql('CREATE INDEX IDX_75E671E8A76ED395 ON git_depot (user_id)');
  34.         $this->addSql('ALTER TABLE organisation CHANGE is_added is_added TINYINT(1) DEFAULT \'0\' NOT NULL');
  35.         $this->addSql('ALTER TABLE subscription DROP FOREIGN KEY FK_A3C664D39E6B1585');
  36.         $this->addSql('DROP INDEX IDX_A3C664D39E6B1585 ON subscription');
  37.         $this->addSql('ALTER TABLE subscription DROP organisation_id');
  38.     }
  39. }