2024-10-17 16:34:44 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
2024-10-25 19:15:26 +02:00
|
|
|
namespace DoctrineMigrations\Latest;
|
2024-10-17 16:34:44 +02:00
|
|
|
|
|
|
|
use Doctrine\DBAL\Schema\Schema;
|
|
|
|
use Doctrine\Migrations\AbstractMigration;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Auto-generated Migration: Please modify to your needs!
|
|
|
|
*/
|
|
|
|
final class Version20241017131858 extends AbstractMigration
|
|
|
|
{
|
|
|
|
public function getDescription(): string
|
|
|
|
{
|
|
|
|
return '';
|
|
|
|
}
|
|
|
|
|
|
|
|
public function up(Schema $schema): void
|
|
|
|
{
|
2024-10-25 19:15:26 +02:00
|
|
|
// this up() migration is auto-generated, please modify it to your needs
|
2024-10-17 16:34:44 +02:00
|
|
|
$this->addSql('CREATE SEQUENCE statut_tables_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
|
|
|
|
$this->addSql('CREATE TABLE statut_tables (id INT NOT NULL, tabl_id INT DEFAULT NULL, libellé VARCHAR(255) NOT NULL, PRIMARY KEY(id))');
|
|
|
|
$this->addSql('CREATE INDEX IDX_33C8A3754DE1870D ON statut_tables (tabl_id)');
|
|
|
|
$this->addSql('ALTER TABLE statut_tables ADD CONSTRAINT FK_33C8A3754DE1870D FOREIGN KEY (tabl_id) REFERENCES tables (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 statut_tables_id_seq CASCADE');
|
|
|
|
$this->addSql('ALTER TABLE statut_tables DROP CONSTRAINT FK_33C8A3754DE1870D');
|
|
|
|
$this->addSql('DROP TABLE statut_tables');
|
|
|
|
}
|
|
|
|
}
|