#4988 - new-module-agency #2303
|
@ -180,5 +180,8 @@
|
||||||
},
|
},
|
||||||
"AgencyLog": {
|
"AgencyLog": {
|
||||||
"dataSource": "vn"
|
"dataSource": "vn"
|
||||||
|
},
|
||||||
|
"AgencyWorkCenter": {
|
||||||
|
"dataSource": "vn"
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -0,0 +1,36 @@
|
||||||
|
{
|
||||||
|
"name": "AgencyWorkCenter",
|
||||||
|
"base": "VnModel",
|
||||||
|
"options": {
|
||||||
|
"mysql": {
|
||||||
|
"table": "agencyWorkCenter"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"properties": {
|
||||||
|
"id": {
|
||||||
|
"id": true,
|
||||||
|
"type": "number",
|
||||||
|
"forceId": false
|
||||||
|
},
|
||||||
|
"agencyFk": {
|
||||||
|
"type": "number",
|
||||||
|
"required": false
|
||||||
|
},
|
||||||
|
"workCenterFk": {
|
||||||
|
"type": "number",
|
||||||
|
"required": false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"relations": {
|
||||||
|
"agency": {
|
||||||
|
"type": "belongsTo",
|
||||||
|
"model": "WorkCenter",
|
||||||
|
"foreignKey": "agencyFk"
|
||||||
|
},
|
||||||
|
"workCenter": {
|
||||||
|
"type": "belongsTo",
|
||||||
|
"model": "WorkCenter",
|
||||||
|
"foreignKey": "workCenterFk"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -3,3 +3,7 @@ INSERT INTO salix.ACL (model, property, accessType, permission, principalType, p
|
||||||
VALUES('Agency', '*', 'READ', 'ALLOW', 'ROLE', 'employee');
|
VALUES('Agency', '*', 'READ', 'ALLOW', 'ROLE', 'employee');
|
||||||
INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId)
|
INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId)
|
||||||
VALUES ('AgencyLog','*','READ','ALLOW','ROLE','employee');
|
VALUES ('AgencyLog','*','READ','ALLOW','ROLE','employee');
|
||||||
|
|
||||||
|
INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId)
|
||||||
|
VALUES ('Agency','*','WRITE','ALLOW','ROLE','deliveryAssistant');
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
CREATE TABLE IF NOT EXISTS vn.agencyWorkCenter (
|
||||||
|
id INT UNSIGNED auto_increment NOT NULL,
|
||||||
|
agencyFk smallint(5) unsigned NULL,
|
||||||
|
workCenterFk int(11) NULL,
|
||||||
|
CONSTRAINT agencyWorkCenter_pk PRIMARY KEY (id),
|
||||||
|
CONSTRAINT agencyWorkCenter_agency_FK FOREIGN KEY (agencyFk) REFERENCES vn.agency(id) ON DELETE CASCADE,
|
||||||
|
CONSTRAINT agencyWorkCenter_workCenter_FK FOREIGN KEY (workCenterFk) REFERENCES vn.workCenter(id)
|
||||||
|
)
|
||||||
|
ENGINE=InnoDB
|
||||||
|
DEFAULT CHARSET=utf8mb3
|
||||||
|
COLLATE=utf8mb3_unicode_ci
|
||||||
|
COMMENT='refs #4988';
|
||||||
|
|
||||||
|
INSERT INTO vn.agencyWorkCenter (agencyFk, workCenterFk)
|
||||||
|
SELECT id, workCenterFk
|
||||||
|
FROM vn.agency
|
||||||
|
WHERE workCenterFk IS NOT NULL;
|
Loading…
Reference in New Issue