57 lines
2.7 KiB
PHP
57 lines
2.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 Version20241017131649 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 customer_id_seq CASCADE');
|
|
$this->addSql('DROP SEQUENCE discount_id_seq CASCADE');
|
|
$this->addSql('DROP SEQUENCE dishes_id_seq CASCADE');
|
|
$this->addSql('DROP SEQUENCE order_id_seq CASCADE');
|
|
$this->addSql('DROP SEQUENCE order_detail_id_seq CASCADE');
|
|
$this->addSql('DROP SEQUENCE reservation_id_seq CASCADE');
|
|
$this->addSql('DROP SEQUENCE status_order_id_seq CASCADE');
|
|
$this->addSql('DROP SEQUENCE status_table_id_seq CASCADE');
|
|
$this->addSql('DROP SEQUENCE table_id_seq CASCADE');
|
|
$this->addSql('DROP SEQUENCE user_id_seq CASCADE');
|
|
$this->addSql('ALTER TABLE utilisateurs ADD tabl_id INT DEFAULT NULL');
|
|
$this->addSql('ALTER TABLE utilisateurs ADD CONSTRAINT FK_497B315E4DE1870D FOREIGN KEY (tabl_id) REFERENCES tables (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
|
$this->addSql('CREATE INDEX IDX_497B315E4DE1870D ON utilisateurs (tabl_id)');
|
|
}
|
|
|
|
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 customer_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
|
|
$this->addSql('CREATE SEQUENCE discount_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
|
|
$this->addSql('CREATE SEQUENCE dishes_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
|
|
$this->addSql('CREATE SEQUENCE order_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
|
|
$this->addSql('CREATE SEQUENCE order_detail_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
|
|
$this->addSql('CREATE SEQUENCE reservation_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
|
|
$this->addSql('CREATE SEQUENCE status_order_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
|
|
$this->addSql('CREATE SEQUENCE status_table_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
|
|
$this->addSql('CREATE SEQUENCE table_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
|
|
$this->addSql('CREATE SEQUENCE user_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
|
|
$this->addSql('ALTER TABLE utilisateurs DROP CONSTRAINT FK_497B315E4DE1870D');
|
|
$this->addSql('DROP INDEX IDX_497B315E4DE1870D');
|
|
$this->addSql('ALTER TABLE utilisateurs DROP tabl_id');
|
|
}
|
|
}
|