CREATE TABLE tx_tarif_type (id INT AUTO_INCREMENT NOT NULL, trt_label VARCHAR(45) DEFAULT NULL, trt_unit VARCHAR(45) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
CREATE TABLE tx_tarif (id INT AUTO_INCREMENT NOT NULL, tx_tarif_type_id INT DEFAULT NULL, tx_trajet_id INT DEFAULT NULL, tx_vehicule_id INT DEFAULT NULL, trf_price DOUBLE PRECISION DEFAULT NULL, trf_extra VARCHAR(255) DEFAULT NULL, INDEX IDX_A7341AB9E6FF65DF (tx_tarif_type_id), INDEX IDX_A7341AB9BB7CAE1A (tx_trajet_id), INDEX IDX_A7341AB9ADADABF0 (tx_vehicule_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
ALTER TABLE tx_tarif ADD CONSTRAINT FK_A7341AB9E6FF65DF FOREIGN KEY (tx_tarif_type_id) REFERENCES tx_tarif_type (id);
ALTER TABLE tx_tarif ADD CONSTRAINT FK_A7341AB9BB7CAE1A FOREIGN KEY (tx_trajet_id) REFERENCES tx_trajet (id);
ALTER TABLE tx_tarif ADD CONSTRAINT FK_A7341AB9ADADABF0 FOREIGN KEY (tx_vehicule_id) REFERENCES tx_vehicule (id);