<?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 Version20241112083010 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 t_step DROP FOREIGN KEY FK_F9CF974E2C2AC5D3');
// $this->addSql('DROP TABLE t_step');
// $this->addSql('ALTER TABLE step DROP FOREIGN KEY FK_43B9FE3C7E9E4C8C');
// $this->addSql('DROP INDEX IDX_43B9FE3C7E9E4C8C ON step');
// $this->addSql('ALTER TABLE step DROP url, DROP notation, CHANGE photo_id revision_id INT DEFAULT NULL');
// $this->addSql('ALTER TABLE step ADD CONSTRAINT FK_43B9FE3C1DFA7C8F FOREIGN KEY (revision_id) REFERENCES revision (id)');
// $this->addSql('CREATE UNIQUE INDEX UNIQ_43B9FE3C1DFA7C8F ON step (revision_id)');
// $this->addSql('CREATE INDEX deleted_at_idx ON step (deleted_at)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE t_step (id INT AUTO_INCREMENT NOT NULL, translatable_id INT DEFAULT NULL, locale VARCHAR(8) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, name LONGTEXT CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, INDEX IDX_F9CF974E2C2AC5D3 (translatable_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('ALTER TABLE t_step ADD CONSTRAINT FK_F9CF974E2C2AC5D3 FOREIGN KEY (translatable_id) REFERENCES step (id) ON UPDATE NO ACTION ON DELETE NO ACTION');
$this->addSql('ALTER TABLE step DROP FOREIGN KEY FK_43B9FE3C1DFA7C8F');
$this->addSql('DROP INDEX UNIQ_43B9FE3C1DFA7C8F ON step');
$this->addSql('DROP INDEX deleted_at_idx ON step');
$this->addSql('ALTER TABLE step ADD url VARCHAR(255) NOT NULL, ADD notation INT NOT NULL, CHANGE revision_id photo_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE step ADD CONSTRAINT FK_43B9FE3C7E9E4C8C FOREIGN KEY (photo_id) REFERENCES media (id) ON UPDATE NO ACTION ON DELETE NO ACTION');
$this->addSql('CREATE INDEX IDX_43B9FE3C7E9E4C8C ON step (photo_id)');
}
}