caisse-bliss/migrations/Version20250214095832.php

38 lines
1.9 KiB
PHP
Raw Permalink Normal View History

2025-02-14 11:00:20 +01:00
<?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 Version20250214095832 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 festvial (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, date_creation DATE DEFAULT NULL, chiffre_affaire DOUBLE PRECISION DEFAULT NULL, clients_count INT DEFAULT NULL, commentaire VARCHAR(500) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE group_of_products_selling (group_of_products_id INT NOT NULL, selling_id INT NOT NULL, INDEX IDX_22D44E55748B7BD1 (group_of_products_id), INDEX IDX_22D44E55155A4545 (selling_id), PRIMARY KEY(group_of_products_id, selling_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE group_of_products_selling ADD CONSTRAINT FK_22D44E55748B7BD1 FOREIGN KEY (group_of_products_id) REFERENCES group_of_products (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE group_of_products_selling ADD CONSTRAINT FK_22D44E55155A4545 FOREIGN KEY (selling_id) REFERENCES selling (id) ON DELETE CASCADE');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE group_of_products_selling DROP FOREIGN KEY FK_22D44E55748B7BD1');
$this->addSql('ALTER TABLE group_of_products_selling DROP FOREIGN KEY FK_22D44E55155A4545');
$this->addSql('DROP TABLE festvial');
$this->addSql('DROP TABLE group_of_products_selling');
}
}