8032-devToTest_2440 #3009
|
@ -1,12 +1,10 @@
|
||||||
DROP TABLE IF EXISTS vn.wagonTypeTray;
|
|
||||||
|
|
||||||
CREATE OR REPLACE TABLE vn.wagonTypeTray (
|
CREATE OR REPLACE TABLE vn.wagonTypeTray (
|
||||||
id INT UNSIGNED auto_increment NULL,
|
id INT UNSIGNED auto_increment NULL,
|
||||||
wagonTypeFk int(11) unsigned NULL,
|
wagonTypeFk int(11) unsigned NULL,
|
||||||
height INT UNSIGNED NULL,
|
height INT UNSIGNED NULL,
|
||||||
wagonTypeColorFk int(11) unsigned NULL,
|
wagonTypeColorFk int(11) unsigned NULL,
|
||||||
CONSTRAINT wagonTypeTray_pk PRIMARY KEY (id),
|
CONSTRAINT wagonTypeTray_pk PRIMARY KEY (id),
|
||||||
CONSTRAINT wagonTypeTray_wagonType_FK FOREIGN KEY (wagonTypeFk) REFERENCES vn.wagonType(id),
|
CONSTRAINT wagonTypeTray_wagonType_FK FOREIGN KEY (wagonTypeFk) REFERENCES vn.wagonType(id) ON DELETE CASCADE ON UPDATE RESTRICT,
|
||||||
CONSTRAINT wagonTypeTray_wagonTypeColor_FK FOREIGN KEY (wagonTypeColorFk) REFERENCES vn.wagonTypeColor(id)
|
CONSTRAINT wagonTypeTray_wagonTypeColor_FK FOREIGN KEY (wagonTypeColorFk) REFERENCES vn.wagonTypeColor(id)
|
||||||
)
|
)
|
||||||
ENGINE=InnoDB
|
ENGINE=InnoDB
|
||||||
|
@ -17,5 +15,3 @@ ALTER TABLE vn.wagonConfig ADD IF NOT EXISTS defaultHeight INT UNSIGNED DEFAULT
|
||||||
ALTER TABLE vn.wagonConfig ADD IF NOT EXISTS defaultTrayColorFk int(11) unsigned NULL COMMENT 'Default color for a base tray';
|
ALTER TABLE vn.wagonConfig ADD IF NOT EXISTS defaultTrayColorFk int(11) unsigned NULL COMMENT 'Default color for a base tray';
|
||||||
ALTER TABLE vn.wagonConfig ADD CONSTRAINT wagonConfig_wagonTypeColor_FK FOREIGN KEY (defaultTrayColorFk) REFERENCES vn.wagonTypeColor(id);
|
ALTER TABLE vn.wagonConfig ADD CONSTRAINT wagonConfig_wagonTypeColor_FK FOREIGN KEY (defaultTrayColorFk) REFERENCES vn.wagonTypeColor(id);
|
||||||
|
|
||||||
ALTER TABLE vn.wagonTypeTray DROP FOREIGN KEY wagonTypeTray_wagonType_FK;
|
|
||||||
ALTER TABLE vn.wagonTypeTray ADD CONSTRAINT wagonTypeTray_wagonType_FK FOREIGN KEY (wagonTypeFk) REFERENCES vn.wagonType(id) ON DELETE CASCADE ON UPDATE RESTRICT;
|
|
||||||
|
|
Loading…
Reference in New Issue