migrations/Version20241003122652.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 Version20241003122652 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('CREATE TABLE tc_delayed_mail_configuration (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, tcard_id INT DEFAULT NULL, triggers VARCHAR(255) DEFAULT NULL, INDEX tcard_id (tcard_id), INDEX user_id (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB');
  19.         $this->addSql('CREATE TABLE tc_delayed_mail_send_slots (id INT AUTO_INCREMENT NOT NULL, slot_id INT DEFAULT NULL, tcard_id INT DEFAULT NULL, created_at DATETIME DEFAULT NULL, INDEX slot_id (slot_id), INDEX tcard_id (tcard_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB');
  20.         $this->addSql('ALTER TABLE tc_delayed_mail_configuration ADD CONSTRAINT FK_B6E089CA76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
  21.         $this->addSql('ALTER TABLE tc_delayed_mail_configuration ADD CONSTRAINT FK_B6E089C9A98055D FOREIGN KEY (tcard_id) REFERENCES tc_tcard (id)');
  22.         $this->addSql('ALTER TABLE tc_delayed_mail_send_slots ADD CONSTRAINT FK_B1E7863F59E5119C FOREIGN KEY (slot_id) REFERENCES tc_tcard_checksheet_status (id)');
  23.         $this->addSql('ALTER TABLE tc_delayed_mail_send_slots ADD CONSTRAINT FK_B1E7863F9A98055D FOREIGN KEY (tcard_id) REFERENCES tc_tcard (id)');
  24.         $this->addSql('ALTER TABLE company_settings ADD enable_send_delay_audit_email TINYINT(1) NOT NULL');
  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 tc_delayed_mail_configuration DROP FOREIGN KEY FK_B6E089CA76ED395');
  30.         $this->addSql('ALTER TABLE tc_delayed_mail_configuration DROP FOREIGN KEY FK_B6E089C9A98055D');
  31.         $this->addSql('ALTER TABLE tc_delayed_mail_send_slots DROP FOREIGN KEY FK_B1E7863F59E5119C');
  32.         $this->addSql('ALTER TABLE tc_delayed_mail_send_slots DROP FOREIGN KEY FK_B1E7863F9A98055D');
  33.         $this->addSql('DROP TABLE tc_delayed_mail_configuration');
  34.         $this->addSql('DROP TABLE tc_delayed_mail_send_slots');
  35.         $this->addSql('ALTER TABLE company_settings DROP enable_send_delay_audit_email');
  36.     }
  37. }