<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20241003122652 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$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');
$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');
$this->addSql('ALTER TABLE tc_delayed_mail_configuration ADD CONSTRAINT FK_B6E089CA76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE tc_delayed_mail_configuration ADD CONSTRAINT FK_B6E089C9A98055D FOREIGN KEY (tcard_id) REFERENCES tc_tcard (id)');
$this->addSql('ALTER TABLE tc_delayed_mail_send_slots ADD CONSTRAINT FK_B1E7863F59E5119C FOREIGN KEY (slot_id) REFERENCES tc_tcard_checksheet_status (id)');
$this->addSql('ALTER TABLE tc_delayed_mail_send_slots ADD CONSTRAINT FK_B1E7863F9A98055D FOREIGN KEY (tcard_id) REFERENCES tc_tcard (id)');
$this->addSql('ALTER TABLE company_settings ADD enable_send_delay_audit_email TINYINT(1) NOT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE tc_delayed_mail_configuration DROP FOREIGN KEY FK_B6E089CA76ED395');
$this->addSql('ALTER TABLE tc_delayed_mail_configuration DROP FOREIGN KEY FK_B6E089C9A98055D');
$this->addSql('ALTER TABLE tc_delayed_mail_send_slots DROP FOREIGN KEY FK_B1E7863F59E5119C');
$this->addSql('ALTER TABLE tc_delayed_mail_send_slots DROP FOREIGN KEY FK_B1E7863F9A98055D');
$this->addSql('DROP TABLE tc_delayed_mail_configuration');
$this->addSql('DROP TABLE tc_delayed_mail_send_slots');
$this->addSql('ALTER TABLE company_settings DROP enable_send_delay_audit_email');
}
}