<?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 Version20250411221703 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 w_template (id CHAR(36) NOT NULL COMMENT \'(DC2Type:uuid)\', creator_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', workspace_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', shared TINYINT(1) NOT NULL, stream LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\', columns LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\', documents LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\', events LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\', tasks LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\', whiteboards LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\', body LONGTEXT DEFAULT NULL, name VARCHAR(255) NOT NULL, pending_deletion TINYINT(1) NOT NULL, deleted_at DATETIME DEFAULT NULL, created_at DATETIME NOT NULL, modified_at DATETIME NOT NULL, INDEX idx_workspace (workspace_id), INDEX idx_creator (creator_id), INDEX idx_name (name), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE w_template ADD CONSTRAINT FK_A8B6B8DA61220EA6 FOREIGN KEY (creator_id) REFERENCES user (id) ON DELETE SET NULL');
$this->addSql('ALTER TABLE w_template ADD CONSTRAINT FK_A8B6B8DA82D40A1F FOREIGN KEY (workspace_id) REFERENCES workspace (id) ON DELETE CASCADE');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE w_template DROP FOREIGN KEY FK_A8B6B8DA61220EA6');
$this->addSql('ALTER TABLE w_template DROP FOREIGN KEY FK_A8B6B8DA82D40A1F');
$this->addSql('DROP TABLE w_template');
}
}