salix/db/versions/.archive/10550-grayMonstera/00-editorFk.sql

228 lines
10 KiB
SQL

ALTER TABLE `vn`.`ticket`
ADD IF NOT EXISTS editorFk INT UNSIGNED NULL,
ADD CONSTRAINT ticket_fk_editor FOREIGN KEY IF NOT EXISTS (editorFk) REFERENCES account.`user`(id);
ALTER TABLE `vn`.`sale`
ADD IF NOT EXISTS editorFk INT UNSIGNED NULL,
ADD CONSTRAINT sale_fk_editor FOREIGN KEY IF NOT EXISTS (editorFk) REFERENCES account.`user`(id);
ALTER TABLE `vn`.`entry`
ADD IF NOT EXISTS editorFk INT UNSIGNED NULL,
ADD CONSTRAINT entry_fk_editor FOREIGN KEY IF NOT EXISTS (editorFk) REFERENCES account.`user`(id);
ALTER TABLE `vn`.`buy`
ADD IF NOT EXISTS editorFk INT UNSIGNED NULL,
ADD CONSTRAINT buy_fk_editor FOREIGN KEY IF NOT EXISTS (editorFk) REFERENCES account.`user`(id);
ALTER TABLE `vn`.`route`
ADD IF NOT EXISTS editorFk INT UNSIGNED NULL,
ADD CONSTRAINT route_fk_editor FOREIGN KEY IF NOT EXISTS (editorFk) REFERENCES account.`user`(id);
ALTER TABLE `vn`.`travel`
ADD IF NOT EXISTS editorFk INT UNSIGNED NULL,
ADD CONSTRAINT travel_fk_editor FOREIGN KEY IF NOT EXISTS (editorFk) REFERENCES account.`user`(id);
ALTER TABLE `vn`.`business`
ADD IF NOT EXISTS editorFk INT UNSIGNED NULL,
ADD CONSTRAINT business_fk_editor FOREIGN KEY IF NOT EXISTS (editorFk) REFERENCES account.`user`(id);
ALTER TABLE `vn`.`claimBeginning`
ADD IF NOT EXISTS editorFk INT UNSIGNED NULL,
ADD CONSTRAINT claimBeginning_fk_editor FOREIGN KEY IF NOT EXISTS (editorFk) REFERENCES account.`user`(id);
ALTER TABLE `vn`.`claimDevelopment`
ADD IF NOT EXISTS editorFk INT UNSIGNED NULL,
ADD CONSTRAINT claimDevelopment_fk_editor FOREIGN KEY IF NOT EXISTS (editorFk) REFERENCES account.`user`(id);
ALTER TABLE `vn`.`claimDms`
ADD IF NOT EXISTS editorFk INT UNSIGNED NULL,
ADD CONSTRAINT claimDms_fk_editor FOREIGN KEY IF NOT EXISTS (editorFk) REFERENCES account.`user`(id);
ALTER TABLE `vn`.`claimEnd`
ADD IF NOT EXISTS editorFk INT UNSIGNED NULL,
ADD CONSTRAINT claimEnd_fk_editor FOREIGN KEY IF NOT EXISTS (editorFk) REFERENCES account.`user`(id);
ALTER TABLE `vn`.`claimObservation`
ADD IF NOT EXISTS editorFk INT UNSIGNED NULL,
ADD CONSTRAINT claimObservation_fk_editor FOREIGN KEY IF NOT EXISTS (editorFk) REFERENCES account.`user`(id);
ALTER TABLE `vn`.`claimState`
ADD IF NOT EXISTS editorFk INT UNSIGNED NULL,
ADD CONSTRAINT claimState_fk_editor FOREIGN KEY IF NOT EXISTS (editorFk) REFERENCES account.`user`(id);
ALTER TABLE `vn`.`claim`
ADD IF NOT EXISTS editorFk INT UNSIGNED NULL,
ADD CONSTRAINT claim_fk_editor FOREIGN KEY IF NOT EXISTS (editorFk) REFERENCES account.`user`(id);
ALTER TABLE `vn`.`address`
ADD IF NOT EXISTS editorFk INT UNSIGNED NULL,
ADD CONSTRAINT address_fk_editor FOREIGN KEY IF NOT EXISTS (editorFk) REFERENCES account.`user`(id);
ALTER TABLE `vn`.`clientContact`
ADD IF NOT EXISTS editorFk INT UNSIGNED NULL,
ADD CONSTRAINT clientContact_fk_editor FOREIGN KEY IF NOT EXISTS (editorFk) REFERENCES account.`user`(id);
ALTER TABLE `vn`.`clientDms`
ADD IF NOT EXISTS editorFk INT UNSIGNED NULL,
ADD CONSTRAINT clientDms_fk_editor FOREIGN KEY IF NOT EXISTS (editorFk) REFERENCES account.`user`(id);
ALTER TABLE `vn`.`clientObservation`
ADD IF NOT EXISTS editorFk INT UNSIGNED NULL,
ADD CONSTRAINT clientObservation_fk_editor FOREIGN KEY IF NOT EXISTS (editorFk) REFERENCES account.`user`(id);
ALTER TABLE `vn`.`clientSample`
ADD IF NOT EXISTS editorFk INT UNSIGNED NULL,
ADD CONSTRAINT clientSample_fk_editor FOREIGN KEY IF NOT EXISTS (editorFk) REFERENCES account.`user`(id);
ALTER TABLE `vn`.`client`
ADD IF NOT EXISTS editorFk INT UNSIGNED NULL,
ADD CONSTRAINT client_fk_editor FOREIGN KEY IF NOT EXISTS (editorFk) REFERENCES account.`user`(id);
ALTER TABLE `vn`.`greuge`
ADD IF NOT EXISTS editorFk INT UNSIGNED NULL,
ADD CONSTRAINT greuge_fk_editor FOREIGN KEY IF NOT EXISTS (editorFk) REFERENCES account.`user`(id);
ALTER TABLE `vn`.`recovery`
ADD IF NOT EXISTS editorFk INT UNSIGNED NULL,
ADD CONSTRAINT recovery_fk_editor FOREIGN KEY IF NOT EXISTS (editorFk) REFERENCES account.`user`(id);
ALTER TABLE `vn`.`entryObservation`
ADD IF NOT EXISTS editorFk INT UNSIGNED NULL,
ADD CONSTRAINT entryObservation_fk_editor FOREIGN KEY IF NOT EXISTS (editorFk) REFERENCES account.`user`(id);
ALTER TABLE `vn`.`invoiceInTax`
ADD IF NOT EXISTS editorFk INT UNSIGNED NULL,
ADD CONSTRAINT invoiceInTax_fk_editor FOREIGN KEY IF NOT EXISTS (editorFk) REFERENCES account.`user`(id);
ALTER TABLE `vn`.`invoiceIn`
ADD IF NOT EXISTS editorFk INT UNSIGNED NULL,
ADD CONSTRAINT invoiceIn_fk_editor FOREIGN KEY IF NOT EXISTS (editorFk) REFERENCES account.`user`(id);
ALTER TABLE `vn`.`itemBarcode`
ADD IF NOT EXISTS editorFk INT UNSIGNED NULL,
ADD CONSTRAINT itemBarcode_fk_editor FOREIGN KEY IF NOT EXISTS (editorFk) REFERENCES account.`user`(id);
ALTER TABLE `vn`.`itemBotanical`
ADD IF NOT EXISTS editorFk INT UNSIGNED NULL,
ADD CONSTRAINT itemBotanical_fk_editor FOREIGN KEY IF NOT EXISTS (editorFk) REFERENCES account.`user`(id);
ALTER TABLE `vn`.`itemTag`
ADD IF NOT EXISTS editorFk INT UNSIGNED NULL,
ADD CONSTRAINT itemTag_fk_editor FOREIGN KEY IF NOT EXISTS (editorFk) REFERENCES account.`user`(id);
ALTER TABLE `vn`.`itemTaxCountry`
ADD IF NOT EXISTS editorFk INT UNSIGNED NULL,
ADD CONSTRAINT itemTaxCountry_fk_editor FOREIGN KEY IF NOT EXISTS (editorFk) REFERENCES account.`user`(id);
ALTER TABLE `vn`.`shelving`
ADD IF NOT EXISTS editorFk INT UNSIGNED NULL,
ADD CONSTRAINT shelving_fk_editor FOREIGN KEY IF NOT EXISTS (editorFk) REFERENCES account.`user`(id);
ALTER TABLE `vn`.`supplierAccount`
ADD IF NOT EXISTS editorFk INT UNSIGNED NULL,
ADD CONSTRAINT supplierAccount_fk_editor FOREIGN KEY IF NOT EXISTS (editorFk) REFERENCES account.`user`(id);
ALTER TABLE `vn`.`supplierAddress`
ADD IF NOT EXISTS editorFk INT UNSIGNED NULL,
ADD CONSTRAINT supplierAddress_fk_editor FOREIGN KEY IF NOT EXISTS (editorFk) REFERENCES account.`user`(id);
ALTER TABLE `vn`.`supplierContact`
ADD IF NOT EXISTS editorFk INT UNSIGNED NULL,
ADD CONSTRAINT supplierContact_fk_editor FOREIGN KEY IF NOT EXISTS (editorFk) REFERENCES account.`user`(id);
ALTER TABLE `vn`.`supplier`
ADD IF NOT EXISTS editorFk INT UNSIGNED NULL,
ADD CONSTRAINT supplier_fk_editor FOREIGN KEY IF NOT EXISTS (editorFk) REFERENCES account.`user`(id);
ALTER TABLE `vn`.`expedition`
ADD IF NOT EXISTS editorFk INT UNSIGNED NULL,
ADD CONSTRAINT expedition_fk_editor FOREIGN KEY IF NOT EXISTS (editorFk) REFERENCES account.`user`(id);
ALTER TABLE `vn`.`ticketDms`
ADD IF NOT EXISTS editorFk INT UNSIGNED NULL,
ADD CONSTRAINT ticketDms_fk_editor FOREIGN KEY IF NOT EXISTS (editorFk) REFERENCES account.`user`(id);
ALTER TABLE `vn`.`ticketObservation`
ADD IF NOT EXISTS editorFk INT UNSIGNED NULL,
ADD CONSTRAINT ticketObservation_fk_editor FOREIGN KEY IF NOT EXISTS (editorFk) REFERENCES account.`user`(id);
ALTER TABLE `vn`.`ticketPackaging`
ADD IF NOT EXISTS editorFk INT UNSIGNED NULL,
ADD CONSTRAINT ticketPackaging_fk_editor FOREIGN KEY IF NOT EXISTS (editorFk) REFERENCES account.`user`(id);
ALTER TABLE `vn`.`ticketRefund`
ADD IF NOT EXISTS editorFk INT UNSIGNED NULL,
ADD CONSTRAINT ticketRefund_fk_editor FOREIGN KEY IF NOT EXISTS (editorFk) REFERENCES account.`user`(id);
ALTER TABLE `vn`.`ticketRequest`
ADD IF NOT EXISTS editorFk INT UNSIGNED NULL,
ADD CONSTRAINT ticketRequest_fk_editor FOREIGN KEY IF NOT EXISTS (editorFk) REFERENCES account.`user`(id);
ALTER TABLE `vn`.`ticketService`
ADD IF NOT EXISTS editorFk INT UNSIGNED NULL,
ADD CONSTRAINT ticketService_fk_editor FOREIGN KEY IF NOT EXISTS (editorFk) REFERENCES account.`user`(id);
ALTER TABLE `vn`.`ticketTracking`
ADD IF NOT EXISTS editorFk INT UNSIGNED NULL,
ADD CONSTRAINT ticketTracking_fk_editor FOREIGN KEY IF NOT EXISTS (editorFk) REFERENCES account.`user`(id);
ALTER TABLE `vn`.`ticketWeekly`
ADD IF NOT EXISTS editorFk INT UNSIGNED NULL,
ADD CONSTRAINT ticketWeekly_fk_editor FOREIGN KEY IF NOT EXISTS (editorFk) REFERENCES account.`user`(id);
ALTER TABLE `vn`.`travelThermograph`
ADD IF NOT EXISTS editorFk INT UNSIGNED NULL,
ADD CONSTRAINT travelThermograph_fk_editor FOREIGN KEY IF NOT EXISTS (editorFk) REFERENCES account.`user`(id);
ALTER TABLE `vn`.`workerDocument`
ADD IF NOT EXISTS editorFk INT UNSIGNED NULL,
ADD CONSTRAINT workerDocument_fk_editor FOREIGN KEY IF NOT EXISTS (editorFk) REFERENCES account.`user`(id);
ALTER TABLE `vn`.`worker`
ADD IF NOT EXISTS editorFk INT UNSIGNED NULL,
ADD CONSTRAINT worker_fk_editor FOREIGN KEY IF NOT EXISTS (editorFk) REFERENCES account.`user`(id);
ALTER TABLE `vn`.`zone`
ADD IF NOT EXISTS editorFk INT UNSIGNED NULL,
ADD CONSTRAINT zone_fk_editor FOREIGN KEY IF NOT EXISTS (editorFk) REFERENCES account.`user`(id);
ALTER TABLE `vn`.`zoneEvent`
ADD IF NOT EXISTS editorFk INT UNSIGNED NULL,
ADD CONSTRAINT zoneEvent_fk_editor FOREIGN KEY IF NOT EXISTS (editorFk) REFERENCES account.`user`(id);
ALTER TABLE `vn`.`zoneExclusion`
ADD IF NOT EXISTS editorFk INT UNSIGNED NULL,
ADD CONSTRAINT zoneExclusion_fk_editor FOREIGN KEY IF NOT EXISTS (editorFk) REFERENCES account.`user`(id);
ALTER TABLE `vn`.`zoneIncluded`
ADD IF NOT EXISTS editorFk INT UNSIGNED NULL,
ADD CONSTRAINT zoneIncluded_fk_editor FOREIGN KEY IF NOT EXISTS (editorFk) REFERENCES account.`user`(id);
ALTER TABLE `vn`.`zoneWarehouse`
ADD IF NOT EXISTS editorFk INT UNSIGNED NULL,
ADD CONSTRAINT zoneWarehouse_fk_editor FOREIGN KEY IF NOT EXISTS (editorFk) REFERENCES account.`user`(id);
ALTER TABLE `account`.`user`
ADD IF NOT EXISTS editorFk INT UNSIGNED NULL,
ADD CONSTRAINT user_fk_editor FOREIGN KEY IF NOT EXISTS (editorFk) REFERENCES account.`user`(id);
ALTER TABLE `account`.`account`
ADD IF NOT EXISTS editorFk INT UNSIGNED NULL,
ADD CONSTRAINT account_fk_editor FOREIGN KEY IF NOT EXISTS (editorFk) REFERENCES account.`user`(id);
ALTER TABLE `account`.`mailAlias`
ADD IF NOT EXISTS editorFk INT UNSIGNED NULL,
ADD CONSTRAINT mailAlias_fk_editor FOREIGN KEY IF NOT EXISTS (editorFk) REFERENCES account.`user`(id);
ALTER TABLE `account`.`mailForward`
ADD IF NOT EXISTS editorFk INT UNSIGNED NULL,
ADD CONSTRAINT mailForward_fk_editor FOREIGN KEY IF NOT EXISTS (editorFk) REFERENCES account.`user`(id);
ALTER TABLE `account`.`role`
ADD IF NOT EXISTS editorFk INT UNSIGNED NULL,
ADD CONSTRAINT role_fk_editor FOREIGN KEY IF NOT EXISTS (editorFk) REFERENCES account.`user`(id);
ALTER TABLE `account`.`roleInherit`
ADD IF NOT EXISTS editorFk INT UNSIGNED NULL,
ADD CONSTRAINT roleInherit_fk_editor FOREIGN KEY IF NOT EXISTS (editorFk) REFERENCES account.`user`(id);