migrations/Version20230511155540.php line 1
<?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 Version20230511155540 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 act_progression (id INT AUTO_INCREMENT NOT NULL, current_act INT NOT NULL, floor_a TINYINT(1) NOT NULL, floor_b TINYINT(1) NOT NULL, floor_c TINYINT(1) NOT NULL, floor_d TINYINT(1) NOT NULL, started_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', updated_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', is_flagged TINYINT(1) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE user ADD act_progression_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE user ADD CONSTRAINT FK_8D93D649E0228098 FOREIGN KEY (act_progression_id) REFERENCES act_progression (id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_8D93D649E0228098 ON user (act_progression_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE user DROP FOREIGN KEY FK_8D93D649E0228098');
$this->addSql('DROP TABLE act_progression');
$this->addSql('DROP INDEX UNIQ_8D93D649E0228098 ON user');
$this->addSql('ALTER TABLE user DROP act_progression_id');
}
}