feat: refs #7874 add observationTypeFk col
gitea/salix/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Jorge Penadés 2024-09-26 09:08:42 +02:00
parent 0cd20503d2
commit 7c23acde64
2 changed files with 18 additions and 25 deletions

View File

@ -1,18 +1,3 @@
-- vn.clientObservationType ALTER TABLE vn.clientObservation
CREATE TABLE IF NOT EXISTS vn.clientObservationType( ADD COLUMN observationTypeFk TINYINT(3) UNSIGNED,
id tinyint(3) unsigned NOT NULL AUTO_INCREMENT, ADD CONSTRAINT clientObservationTypeFk FOREIGN KEY (observationTypeFk) REFERENCES vn.observationType(id);
clientFk int(11) NOT NULL,
observationTypeFk tinyint(3) unsigned NOT NULL,
description varchar(50) NOT NULL,
PRIMARY KEY (id),
CONSTRAINT `clientFgn` FOREIGN KEY (`clientFk`) REFERENCES `client` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `clientObservationFgn` FOREIGN KEY (`observationTypeFk`) REFERENCES `observationType` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
);
INSERT INTO salix.ACL
SET model = 'ClientObservationType',
property = '*',
accessType = 'READ',
permission = 'ALLOW',
principalType = 'ROLE',
principalId = 'employee';

View File

@ -26,6 +26,10 @@
"created": { "created": {
"type": "date", "type": "date",
"description": "Creation date and time" "description": "Creation date and time"
},
"observationTypeFk": {
"type": "number",
"description": "Type of observation"
} }
}, },
"relations": { "relations": {
@ -44,11 +48,15 @@
"include": { "include": {
"relation": "worker", "relation": "worker",
"scope": { "scope": {
"fields": ["id"], "fields": [
"id"
],
"include": { "include": {
"relation": "user", "relation": "user",
"scope": { "scope": {
"fields": ["nickname"] "fields": [
"nickname"
]
} }
} }
} }