salix/db/versions/10841-orangeGalax/00-entryDms.sql

23 lines
1.0 KiB
MySQL
Raw Normal View History

CREATE OR REPLACE TABLE `vn`.`entryDms` (
`entryFk` int(11) NOT NULL,
`dmsFk` int(11) NOT NULL,
`editorFk` int(10) unsigned DEFAULT NULL,
PRIMARY KEY (`entryFk`,`dmsFk`),
KEY `gestdoc_id` (`dmsFk`),
KEY `entryDms_editor` (`editorFk`),
CONSTRAINT `entryDms_dms` FOREIGN KEY (`dmsFk`) REFERENCES `dms` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `entryDms_editor` FOREIGN KEY (`editorFk`) REFERENCES `account`.`user` (`id`),
CONSTRAINT `entryDms_entry` FOREIGN KEY (`entryFk`) REFERENCES `entry` (`id`) ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`)
VALUES
('WorkerDms', '*', '*', 'ALLOW', 'ROLE', 'employee'),
('EntryDms', '*', '*', 'ALLOW', 'ROLE', 'employee'),
('Entry', 'uploadFile', 'WRITE', 'ALLOW', 'ROLE', 'employee');
UPDATE `salix`.`ACL`
SET accessType = '*'
WHERE model = 'ClientDms'
AND property = '*';