CREATE TABLE tx_vehicule (
id INT AUTO_INCREMENT NOT NULL,
tx_vhc_cat_id INT DEFAULT NULL,
vhc_immatriculation VARCHAR(45) DEFAULT NULL,
vhc_marque VARCHAR(45) DEFAULT NULL,
vhc_serie VARCHAR(45) DEFAULT NULL,
vhc_nbr_place INT NOT NULL,
vhc_annee INT DEFAULT NULL,
vhc_source_energie VARCHAR(45) DEFAULT NULL,
INDEX IDX_2104FB227C436EFD (tx_vhc_cat_id),
PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;

ALTER TABLE tx_vehicule
ADD CONSTRAINT FK_2104FB227C436EFD FOREIGN KEY (tx_vhc_cat_id) REFERENCES tx_vhc_categorie (id);

ALTER TABLE tx_vehicule
DROP FOREIGN KEY FK_2104FB227C436EFD;

ALTER TABLE tx_vehicule
ADD CONSTRAINT FK_2104FB227C436EFD FOREIGN KEY (tx_vhc_cat_id) REFERENCES tx_vhc_categorie (id) ON DELETE CASCADE;
