migrations/Version20251211132245.php line 1
<?phpdeclare(strict_types=1);namespace DoctrineMigrations;use Doctrine\DBAL\Schema\Schema;use Doctrine\Migrations\AbstractMigration;/*** Auto-generated Migration: Please modify to your needs!*/final class Version20251211132245 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 commande_ticket (id BINARY(16) NOT NULL COMMENT \'(DC2Type:ulid)\', tombola_id BINARY(16) NOT NULL COMMENT \'(DC2Type:ulid)\', user_id BINARY(16) NOT NULL COMMENT \'(DC2Type:ulid)\', quantite INT NOT NULL, prix DOUBLE PRECISION NOT NULL, date_paiement DATETIME DEFAULT NULL, mode_paiement VARCHAR(255) DEFAULT NULL, status INT NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, deleted_at DATETIME DEFAULT NULL, INDEX IDX_95F4567677CF40C0 (tombola_id), INDEX IDX_95F45676A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');$this->addSql('CREATE TABLE ticket (id INT AUTO_INCREMENT NOT NULL, commande_id BINARY(16) NOT NULL COMMENT \'(DC2Type:ulid)\', taille VARCHAR(255) NOT NULL, numero INT DEFAULT NULL, INDEX IDX_97A0ADA382EA2E54 (commande_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');$this->addSql('CREATE TABLE tombola (id BINARY(16) NOT NULL COMMENT \'(DC2Type:ulid)\', edition_id BINARY(16) NOT NULL COMMENT \'(DC2Type:ulid)\', titre VARCHAR(255) NOT NULL, nombre_tickets INT NOT NULL, dernier_ticket_vendu INT NOT NULL, ticket_restant INT NOT NULL, dateheure_vente_debut DATETIME NOT NULL, dateheure_vente_fin DATETIME NOT NULL, prix DOUBLE PRECISION NOT NULL, description LONGTEXT DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, deleted_at DATETIME DEFAULT NULL, INDEX IDX_3C12E3C574281A5E (edition_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');$this->addSql('ALTER TABLE commande_ticket ADD CONSTRAINT FK_95F4567677CF40C0 FOREIGN KEY (tombola_id) REFERENCES tombola (id)');$this->addSql('ALTER TABLE commande_ticket ADD CONSTRAINT FK_95F45676A76ED395 FOREIGN KEY (user_id) REFERENCES `user` (id)');$this->addSql('ALTER TABLE ticket ADD CONSTRAINT FK_97A0ADA382EA2E54 FOREIGN KEY (commande_id) REFERENCES commande_ticket (id)');$this->addSql('ALTER TABLE tombola ADD CONSTRAINT FK_3C12E3C574281A5E FOREIGN KEY (edition_id) REFERENCES edition (id)');}public function down(Schema $schema): void{// this down() migration is auto-generated, please modify it to your needs$this->addSql('ALTER TABLE commande_ticket DROP FOREIGN KEY FK_95F4567677CF40C0');$this->addSql('ALTER TABLE commande_ticket DROP FOREIGN KEY FK_95F45676A76ED395');$this->addSql('ALTER TABLE ticket DROP FOREIGN KEY FK_97A0ADA382EA2E54');$this->addSql('ALTER TABLE tombola DROP FOREIGN KEY FK_3C12E3C574281A5E');$this->addSql('DROP TABLE commande_ticket');$this->addSql('DROP TABLE ticket');$this->addSql('DROP TABLE tombola');}}