Open pedro-acsousa opened 9 months ago
ALTER TABLE d42-api-pdc.vehicles ADD COLUMN assembly_plant VARCHAR(45) NULL AFTER status;
d42-api-pdc
vehicles
assembly_plant
status
ALTER TABLE d42-api-pdc.vehicles ADD INDEX Fk_assembly_plant_idx (assembly_plant ASC); ; ALTER TABLE d42-api-pdc.vehicles ADD CONSTRAINT Fk_assembly_plant FOREIGN KEY (assembly_plant) REFERENCES d42-api-pdc.locations (id);
Fk_assembly_plant_idx
Fk_assembly_plant
locations
id
The SQL above contains the transformations needed to add the assembly plant information to the vehicles table via a location FK in the vehicles table
ALTER TABLE
d42-api-pdc
.vehicles
ADD COLUMNassembly_plant
VARCHAR(45) NULL AFTERstatus
;ALTER TABLE
d42-api-pdc
.vehicles
ADD INDEXFk_assembly_plant_idx
(assembly_plant
ASC); ; ALTER TABLEd42-api-pdc
.vehicles
ADD CONSTRAINTFk_assembly_plant
FOREIGN KEY (assembly_plant
) REFERENCESd42-api-pdc
.locations
(id
);The SQL above contains the transformations needed to add the assembly plant information to the vehicles table via a location FK in the vehicles table