<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20231212145308 extends AbstractMigration
{
public function getDescription(): string
{
return 'Draft video';
}
public function up(Schema $schema): void
{
$this->addSql('CREATE TABLE draft_video (id BIGINT UNSIGNED AUTO_INCREMENT NOT NULL, activity_id BIGINT UNSIGNED DEFAULT NULL, curator_user_id BIGINT UNSIGNED NULL COMMENT \'Field for specifying the user responsible for processing activity\', status SMALLINT UNSIGNED DEFAULT 0 NOT NULL, url LONGTEXT NOT NULL, comment LONGTEXT DEFAULT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', updated_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', INDEX IDX_7BB05E0381C06096 (activity_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE draft_video ADD CONSTRAINT FK_7BB05E0381C06096 FOREIGN KEY (activity_id) REFERENCES activity (id)');
$this->addSql('ALTER TABLE campaign ADD is_draft_video TINYINT(1) DEFAULT 0 NOT NULL, ADD draft_video_price decimal(10, 2) UNSIGNED DEFAULT NULL');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE draft_video DROP FOREIGN KEY FK_7BB05E0381C06096');
$this->addSql('DROP TABLE draft_video');
$this->addSql('ALTER TABLE campaign DROP is_draft_video, DROP draft_video_price');
}
}