<?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 Version20240522121115 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 schedule (id INT AUTO_INCREMENT NOT NULL, project_id INT NOT NULL, project_status_id INT NOT NULL, trigger_action_id INT NOT NULL, action_id INT NOT NULL, stage_id INT NOT NULL, internal TINYINT(1) NOT NULL, parameters JSON DEFAULT NULL, schedule JSON NOT NULL, launched TINYINT(1) NOT NULL, skipped TINYINT(1) NOT NULL, schedule_at DATETIME NOT NULL, launched_at DATETIME DEFAULT NULL, slug VARCHAR(255) DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX IDX_5A3811FB166D1F9C (project_id), INDEX IDX_5A3811FB7ACB456A (project_status_id), INDEX IDX_5A3811FBDD2EC6C (trigger_action_id), INDEX IDX_5A3811FB9D32F035 (action_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE schedule ADD CONSTRAINT FK_5A3811FB166D1F9C FOREIGN KEY (project_id) REFERENCES project (id)');
$this->addSql('ALTER TABLE schedule ADD CONSTRAINT FK_5A3811FB7ACB456A FOREIGN KEY (project_status_id) REFERENCES project_status (id)');
$this->addSql('ALTER TABLE schedule ADD CONSTRAINT FK_5A3811FBDD2EC6C FOREIGN KEY (trigger_action_id) REFERENCES `workflow_trigger` (id)');
$this->addSql('ALTER TABLE schedule ADD CONSTRAINT FK_5A3811FB9D32F035 FOREIGN KEY (action_id) REFERENCES `workflow_action` (id)');
$this->addSql('ALTER TABLE project CHANGE status_id status_id INT DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE schedule');
$this->addSql('ALTER TABLE project CHANGE status_id status_id INT NOT NULL');
}
}