6956-2410_devTest #2112

Merged
alexm merged 150 commits from 6956-2410_devTest into test 2024-02-29 09:17:58 +00:00
3 changed files with 11 additions and 19 deletions
Showing only changes of commit 910cc41beb - Show all commits

View File

@ -1,6 +1,6 @@
DELIMITER $$ DELIMITER $$
CREATE OR REPLACE DEFINER=root@localhost TRIGGER vn.supplierDms_beforeInsert CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`supplierDms_beforeInsert`
BEFORE INSERT ON supplierDms BEFORE INSERT ON `supplierDms`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
SET NEW.editorFk = account.myUser_getId(); SET NEW.editorFk = account.myUser_getId();

View File

@ -1,6 +1,6 @@
DELIMITER $$ DELIMITER $$
CREATE OR REPLACE DEFINER=root@localhost TRIGGER vn.supplierDms_beforeUpdate CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`supplierDms_beforeUpdate`
BEFORE UPDATE ON supplierDms BEFORE UPDATE ON `supplierDms`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
SET NEW.editorFk = account.myUser_getId(); SET NEW.editorFk = account.myUser_getId();

View File

@ -1,17 +1,9 @@
CREATE TABLE IF NOT EXISTS vn.supplierDms( ALTER TABLE `vn`.`supplierDms`
id int(11) NOT NULL AUTO_INCREMENT, MODIFY COLUMN supplierFk int(10) unsigned NOT NULL,
supplierFk int(11) NOT NULL, ADD editorFk INT UNSIGNED NULL,
dmsFk int(11) NOT NULL, ADD CONSTRAINT user_Fk FOREIGN KEY (editorFk) REFERENCES account.`user`(id),
editorFk int(10) unsigned DEFAULT NULL, ADD CONSTRAINT dms_FK FOREIGN KEY (dmsFk) REFERENCES vn.dms(id) ON DELETE CASCADE ON UPDATE CASCADE,
PRIMARY KEY (id), ADD CONSTRAINT supplier_Fk FOREIGN KEY (supplierFk) REFERENCES vn.supplier(id) ON UPDATE CASCADE;
CONSTRAINT supplierDms_fk_editor FOREIGN KEY (editorFk) REFERENCES account.user(id),
CONSTRAINT dmsFk FOREIGN KEY (dmsFk) REFERENCES dms(id) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT supplierFk FOREIGN KEY (supplierFk) REFERENCES supplier(id) ON UPDATE CASCADE
);
ALTER TABLE `supplierLog` ALTER TABLE `supplierLog`
MODIFY COLUMN `changedModel` ENUM('Supplier','SupplierAddress','SupplierAccount','SupplierContact','SupplierDms') NOT NULL DEFAULT 'Supplier'; MODIFY COLUMN `changedModel` ENUM('Supplier','SupplierAddress','SupplierAccount','SupplierContact','SupplierDms') NOT NULL DEFAULT 'Supplier';
ALTER TABLE `vn`.`supplierDms`
ADD IF NOT EXISTS editorFk INT UNSIGNED NULL,
ADD CONSTRAINT supplierDms_fk_editor FOREIGN KEY IF NOT EXISTS (editorFk) REFERENCES account.`user`(id);