mirror of
https://gitlab.aliens-lyon.fr/encartes/backend.git
synced 2026-03-17 22:51:04 +01:00
38 lines
1.3 KiB
PHP
38 lines
1.3 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 Version20230131135243 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 SEQUENCE place_name_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
|
|
$this->addSql('CREATE TABLE place_name (id INT NOT NULL, room_id INT DEFAULT NULL, name VARCHAR(255) NOT NULL, PRIMARY KEY(id))');
|
|
$this->addSql('CREATE INDEX IDX_94960EEA54177093 ON place_name (room_id)');
|
|
$this->addSql('ALTER TABLE place_name ADD CONSTRAINT FK_94960EEA54177093 FOREIGN KEY (room_id) REFERENCES place (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
|
}
|
|
|
|
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('DROP SEQUENCE place_name_id_seq CASCADE');
|
|
$this->addSql('ALTER TABLE place_name DROP CONSTRAINT FK_94960EEA54177093');
|
|
$this->addSql('DROP TABLE place_name');
|
|
}
|
|
}
|