<?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 Version20220520075918 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('ALTER TABLE form_actions_set DROP FOREIGN KEY FK_2EC4D53CB149C95E');
$this->addSql('DROP TABLE recurring');
$this->addSql('DROP INDEX UNIQ_2EC4D53CB149C95E ON form_actions_set');
$this->addSql('ALTER TABLE form_actions_set DROP recurring_id');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE recurring (id INT AUTO_INCREMENT NOT NULL, step INT NOT NULL, scale VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, execute_step INT NOT NULL, execute_scale VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, execute_time VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, active TINYINT(1) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('ALTER TABLE form_actions_set ADD recurring_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE form_actions_set ADD CONSTRAINT FK_2EC4D53CB149C95E FOREIGN KEY (recurring_id) REFERENCES recurring (id) ON UPDATE NO ACTION ON DELETE NO ACTION');
$this->addSql('CREATE UNIQUE INDEX UNIQ_2EC4D53CB149C95E ON form_actions_set (recurring_id)');
}
}