ALTER TABLE tx_trajet_intermediaire DROP FOREIGN KEY FK_317960B4BB7CAE1A;
ALTER TABLE tx_trajet_intermediaire ADD CONSTRAINT FK_317960B4BB7CAE1A FOREIGN KEY (tx_trajet_id) REFERENCES tx_trajet (id) ON DELETE CASCADE;
ALTER TABLE tx_trajet_intermediaire DROP FOREIGN KEY FK_317960B458DA626;
ALTER TABLE tx_trajet_intermediaire ADD CONSTRAINT FK_317960B458DA626 FOREIGN KEY (tx_place_id) REFERENCES tx_place (id) ON DELETE CASCADE;
ALTER TABLE tx_tarif DROP FOREIGN KEY FK_A7341AB9ADADABF0;
ALTER TABLE tx_tarif DROP FOREIGN KEY FK_A7341AB9BB7CAE1A;
ALTER TABLE tx_tarif DROP FOREIGN KEY FK_A7341AB9E6FF65DF;
ALTER TABLE tx_tarif ADD CONSTRAINT FK_A7341AB9ADADABF0 FOREIGN KEY (tx_vehicule_id) REFERENCES tx_vehicule (id) ON DELETE CASCADE;
ALTER TABLE tx_tarif ADD CONSTRAINT FK_A7341AB9BB7CAE1A FOREIGN KEY (tx_trajet_id) REFERENCES tx_trajet (id) ON DELETE CASCADE;
ALTER TABLE tx_tarif ADD CONSTRAINT FK_A7341AB9E6FF65DF FOREIGN KEY (tx_tarif_type_id) REFERENCES tx_tarif_type (id) ON DELETE CASCADE;
CREATE UNIQUE INDEX place_ranking_unique ON tx_trajet_intermediaire (trjd_ranking, tx_place_id, tx_trajet_id);
DROP INDEX place_ranking_unique ON tx_trajet_intermediaire;
CREATE UNIQUE INDEX place_ranking_unique ON tx_trajet_intermediaire (trjd_ranking, tx_trajet_id);