migrations/Version20231124160459.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 Version20231124160459 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 reminder ADD orderid_id INT DEFAULT NULL, ADD prospect_id INT DEFAULT NULL, ADD vestiging_id INT DEFAULT NULL, CHANGE datum datum DATE NOT NULL');
  19.         $this->addSql('ALTER TABLE reminder ADD CONSTRAINT FK_40374F406F90D45B FOREIGN KEY (orderid_id) REFERENCES `order` (id)');
  20.         $this->addSql('ALTER TABLE reminder ADD CONSTRAINT FK_40374F40D182060A FOREIGN KEY (prospect_id) REFERENCES `prospect` (id)');
  21.         $this->addSql('ALTER TABLE reminder ADD CONSTRAINT FK_40374F4096ADF99E FOREIGN KEY (vestiging_id) REFERENCES vestiging (id)');
  22.         $this->addSql('CREATE INDEX IDX_40374F406F90D45B ON reminder (orderid_id)');
  23.         $this->addSql('CREATE INDEX IDX_40374F40D182060A ON reminder (prospect_id)');
  24.         $this->addSql('CREATE INDEX IDX_40374F4096ADF99E ON reminder (vestiging_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('ALTER TABLE reminder DROP FOREIGN KEY FK_40374F406F90D45B');
  30.         $this->addSql('ALTER TABLE reminder DROP FOREIGN KEY FK_40374F40D182060A');
  31.         $this->addSql('ALTER TABLE reminder DROP FOREIGN KEY FK_40374F4096ADF99E');
  32.         $this->addSql('DROP INDEX IDX_40374F406F90D45B ON reminder');
  33.         $this->addSql('DROP INDEX IDX_40374F40D182060A ON reminder');
  34.         $this->addSql('DROP INDEX IDX_40374F4096ADF99E ON reminder');
  35.         $this->addSql('ALTER TABLE reminder DROP orderid_id, DROP prospect_id, DROP vestiging_id, CHANGE datum datum DATE DEFAULT NULL');
  36.     }
  37. }