<?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 Version20230524083103 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 email_invoice (id INT AUTO_INCREMENT NOT NULL, invoice_id INT NOT NULL, added_by_id INT NOT NULL, token VARCHAR(255) NOT NULL, opens INT NOT NULL, created_at DATETIME NOT NULL, deleted TINYINT(1) NOT NULL, INDEX IDX_2DA57F8B2989F1FD (invoice_id), INDEX IDX_2DA57F8B55B127A4 (added_by_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE email_invoice ADD CONSTRAINT FK_2DA57F8B2989F1FD FOREIGN KEY (invoice_id) REFERENCES invoice (id)');
$this->addSql('ALTER TABLE email_invoice ADD CONSTRAINT FK_2DA57F8B55B127A4 FOREIGN KEY (added_by_id) REFERENCES users (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE email_invoice DROP FOREIGN KEY FK_2DA57F8B2989F1FD');
$this->addSql('ALTER TABLE email_invoice DROP FOREIGN KEY FK_2DA57F8B55B127A4');
$this->addSql('DROP TABLE email_invoice');
}
}