-- Doctrine Migration File Generated on 2025-05-27 19:32:23

-- Version DoctrineMigrations\Version20250527192303
    CREATE TABLE booking (id INT AUTO_INCREMENT NOT NULL, utilisateur_id INT DEFAULT NULL, booking_type_id INT DEFAULT NULL, client_id INT DEFAULT NULL, vehicule_id INT DEFAULT NULL, magasin_id INT DEFAULT NULL, reference VARCHAR(255) NOT NULL, titre VARCHAR(255) NOT NULL, objet VARCHAR(255) NOT NULL, description LONGTEXT DEFAULT NULL, date_time_debut DATETIME DEFAULT NULL, date_time_fin DATETIME DEFAULT NULL, nom VARCHAR(255) DEFAULT NULL, prenom VARCHAR(255) DEFAULT NULL, tel VARCHAR(255) DEFAULT NULL, email VARCHAR(255) DEFAULT NULL, matricule VARCHAR(255) DEFAULT NULL, chassis VARCHAR(255) DEFAULT NULL, est_honore TINYINT(1) DEFAULT NULL, motscles LONGTEXT DEFAULT NULL, INDEX IDX_E00CEDDEFB88E14F (utilisateur_id), INDEX IDX_E00CEDDE9FF2C9B3 (booking_type_id), INDEX IDX_E00CEDDE19EB6921 (client_id), INDEX IDX_E00CEDDE4A4A3511 (vehicule_id), INDEX IDX_E00CEDDE20096AE3 (magasin_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB;
    CREATE TABLE booking_type (id INT AUTO_INCREMENT NOT NULL, magasin_id INT DEFAULT NULL, title VARCHAR(255) NOT NULL, description LONGTEXT DEFAULT NULL, capacite INT NOT NULL, duree INT NOT NULL, heure_debut DATETIME DEFAULT NULL, heure_fin DATETIME DEFAULT NULL, INDEX IDX_944F756720096AE3 (magasin_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB;
    CREATE TABLE document_template (id INT AUTO_INCREMENT NOT NULL, magasin_id INT DEFAULT NULL, title VARCHAR(255) NOT NULL, document_type VARCHAR(255) NOT NULL, content LONGTEXT NOT NULL, is_active TINYINT(1) NOT NULL, updated_at DATETIME DEFAULT NULL, INDEX IDX_18A1EEDA20096AE3 (magasin_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB;
    CREATE TABLE marque (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB;
    CREATE TABLE modele (id INT AUTO_INCREMENT NOT NULL, marque_id INT DEFAULT NULL, name VARCHAR(255) DEFAULT NULL, INDEX IDX_100285584827B9B2 (marque_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB;
    ALTER TABLE booking ADD CONSTRAINT FK_E00CEDDEFB88E14F FOREIGN KEY (utilisateur_id) REFERENCES utilisateur (id);
    ALTER TABLE booking ADD CONSTRAINT FK_E00CEDDE9FF2C9B3 FOREIGN KEY (booking_type_id) REFERENCES booking_type (id);
    ALTER TABLE booking ADD CONSTRAINT FK_E00CEDDE19EB6921 FOREIGN KEY (client_id) REFERENCES client (id);
    ALTER TABLE booking ADD CONSTRAINT FK_E00CEDDE4A4A3511 FOREIGN KEY (vehicule_id) REFERENCES vehicule (id);
    ALTER TABLE booking ADD CONSTRAINT FK_E00CEDDE20096AE3 FOREIGN KEY (magasin_id) REFERENCES magasin (id);
    ALTER TABLE booking_type ADD CONSTRAINT FK_944F756720096AE3 FOREIGN KEY (magasin_id) REFERENCES magasin (id);
    ALTER TABLE document_template ADD CONSTRAINT FK_18A1EEDA20096AE3 FOREIGN KEY (magasin_id) REFERENCES magasin (id);
    ALTER TABLE modele ADD CONSTRAINT FK_100285584827B9B2 FOREIGN KEY (marque_id) REFERENCES marque (id);
    ALTER TABLE commande ADD CONSTRAINT FK_6EEAA67DFB88E14F FOREIGN KEY (utilisateur_id) REFERENCES utilisateur (id);
    ALTER TABLE commande ADD CONSTRAINT FK_6EEAA67D670C757F FOREIGN KEY (fournisseur_id) REFERENCES fournisseur (id);
    ALTER TABLE commande ADD CONSTRAINT FK_6EEAA67D20096AE3 FOREIGN KEY (magasin_id) REFERENCES magasin (id);
    ALTER TABLE commande_produit ADD CONSTRAINT FK_DF1E9E8782EA2E54 FOREIGN KEY (commande_id) REFERENCES commande (id);
    ALTER TABLE commande_produit ADD CONSTRAINT FK_DF1E9E87F347EFB FOREIGN KEY (produit_id) REFERENCES produit (id);
    ALTER TABLE magasin ADD email_notification TINYINT(1) DEFAULT NULL, ADD sms_notification TINYINT(1) DEFAULT NULL, ADD whatsapp_notification TINYINT(1) DEFAULT NULL, ADD storefront LONGTEXT DEFAULT NULL, CHANGE footer_documents footer_documents LONGTEXT DEFAULT NULL;
    ALTER TABLE reparation CHANGE demande_client demande_client LONGTEXT DEFAULT NULL;
    ALTER TABLE vehicule ADD marque_id INT DEFAULT NULL, ADD modele_id INT DEFAULT NULL;
    ALTER TABLE vehicule ADD CONSTRAINT FK_292FFF1D4827B9B2 FOREIGN KEY (marque_id) REFERENCES marque (id);
    ALTER TABLE vehicule ADD CONSTRAINT FK_292FFF1DAC14B70A FOREIGN KEY (modele_id) REFERENCES modele (id);
    CREATE INDEX IDX_292FFF1D4827B9B2 ON vehicule (marque_id);
    CREATE INDEX IDX_292FFF1DAC14B70A ON vehicule (modele_id);
-- Version DoctrineMigrations\Version20250527192303 update table metadata;
INSERT INTO doctrine_migration_versions (version, executed_at, execution_time) VALUES ('DoctrineMigrations\\Version20250527192303', '2025-05-27 19:32:23', 0);
