Files
SomniaRooms/migrations/Version20240604185317.php

45 lines
1.7 KiB
PHP

<?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 Version20240604185317 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('DROP SEQUENCE config_variable_id_seq CASCADE');
$this->addSql('DROP INDEX uniq_718569538a90aba9');
$this->addSql('ALTER TABLE config_variable DROP CONSTRAINT config_variable_pkey');
$this->addSql('ALTER TABLE config_variable DROP id');
$this->addSql('ALTER TABLE config_variable ALTER section SET NOT NULL');
$this->addSql('ALTER TABLE config_variable ALTER section TYPE VARCHAR(255)');
$this->addSql('ALTER TABLE config_variable ADD PRIMARY KEY (key)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE SCHEMA public');
$this->addSql('CREATE SEQUENCE config_variable_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('DROP INDEX config_variable_pkey');
$this->addSql('ALTER TABLE config_variable ADD id INT NOT NULL');
$this->addSql('ALTER TABLE config_variable ALTER section DROP NOT NULL');
$this->addSql('ALTER TABLE config_variable ALTER section TYPE VARCHAR(64)');
$this->addSql('CREATE UNIQUE INDEX uniq_718569538a90aba9 ON config_variable (key)');
$this->addSql('ALTER TABLE config_variable ADD PRIMARY KEY (id)');
}
}