CREATE TABLE tx_besoin_particulier (id INT AUTO_INCREMENT NOT NULL, bp_libelle VARCHAR(100) NOT NULL, bp_price DOUBLE PRECISION DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE besoin_particuliers_reservations (tx_besoin_particulier_id INT NOT NULL, reservation_id INT NOT NULL, INDEX IDX_383244D2358A7488 (tx_besoin_particulier_id), INDEX IDX_383244D2B83297E7 (reservation_id), PRIMARY KEY(tx_besoin_particulier_id, reservation_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
ALTER TABLE besoin_particuliers_reservations ADD CONSTRAINT FK_383244D2358A7488 FOREIGN KEY (tx_besoin_particulier_id) REFERENCES tx_reservation (id);
ALTER TABLE besoin_particuliers_reservations ADD CONSTRAINT FK_383244D2B83297E7 FOREIGN KEY (reservation_id) REFERENCES tx_besoin_particulier (id);
ALTER TABLE besoin_particuliers_reservations DROP FOREIGN KEY FK_383244D2B83297E7;
ALTER TABLE besoin_particuliers_reservations DROP FOREIGN KEY FK_383244D2358A7488;
DROP INDEX IDX_383244D2B83297E7 ON besoin_particuliers_reservations;
ALTER TABLE besoin_particuliers_reservations DROP PRIMARY KEY;
ALTER TABLE besoin_particuliers_reservations CHANGE reservation_id tx_reservation_id INT NOT NULL;
ALTER TABLE besoin_particuliers_reservations ADD CONSTRAINT FK_383244D2C1BEFDD8 FOREIGN KEY (tx_reservation_id) REFERENCES tx_reservation (id);
ALTER TABLE besoin_particuliers_reservations ADD CONSTRAINT FK_383244D2358A7488 FOREIGN KEY (tx_besoin_particulier_id) REFERENCES tx_besoin_particulier (id);
CREATE INDEX IDX_383244D2C1BEFDD8 ON besoin_particuliers_reservations (tx_reservation_id);
ALTER TABLE besoin_particuliers_reservations ADD PRIMARY KEY (tx_reservation_id, tx_besoin_particulier_id);