<?php
declare(strict_types=1);
namespace CoreMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20240422082348 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 save_pdf (id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', context_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', created_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', updated_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', name VARCHAR(255) NOT NULL, content LONGTEXT NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX IDX_844A05C06B00C1CF (context_id), INDEX IDX_844A05C0B03A8386 (created_by_id), INDEX IDX_844A05C0896DBBDE (updated_by_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE save_pdf ADD CONSTRAINT FK_844A05C06B00C1CF FOREIGN KEY (context_id) REFERENCES context (id)');
$this->addSql('ALTER TABLE save_pdf ADD CONSTRAINT FK_844A05C0B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE save_pdf ADD CONSTRAINT FK_844A05C0896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE save_pdf DROP FOREIGN KEY FK_844A05C06B00C1CF');
$this->addSql('ALTER TABLE save_pdf DROP FOREIGN KEY FK_844A05C0B03A8386');
$this->addSql('ALTER TABLE save_pdf DROP FOREIGN KEY FK_844A05C0896DBBDE');
$this->addSql('DROP TABLE save_pdf');
}
}