<?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 Version20230822135519 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 invoice_downloads (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, establishment_id INT DEFAULT NULL, token VARCHAR(255) NOT NULL, start_date DATETIME NOT NULL, end_date DATETIME NOT NULL, sent_to VARCHAR(255) NOT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', deleted TINYINT(1) NOT NULL, INDEX IDX_2EDC5529A76ED395 (user_id), INDEX IDX_2EDC55298565851 (establishment_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE invoice_downloads ADD CONSTRAINT FK_2EDC5529A76ED395 FOREIGN KEY (user_id) REFERENCES users (id)');
$this->addSql('ALTER TABLE invoice_downloads ADD CONSTRAINT FK_2EDC55298565851 FOREIGN KEY (establishment_id) REFERENCES establishments (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE invoice_downloads DROP FOREIGN KEY FK_2EDC5529A76ED395');
$this->addSql('ALTER TABLE invoice_downloads DROP FOREIGN KEY FK_2EDC55298565851');
$this->addSql('DROP TABLE invoice_downloads');
}
}