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
CREATE TABLE IF NOT EXISTS vn.clientObservationType(
id tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
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';
ALTER TABLE vn.clientObservation
ADD COLUMN observationTypeFk TINYINT(3) UNSIGNED,
ADD CONSTRAINT clientObservationTypeFk FOREIGN KEY (observationTypeFk) REFERENCES vn.observationType(id);

View File

@ -1,10 +1,10 @@
{
"name": "ClientObservation",
"name": "ClientObservation",
"description": "Client notes",
"base": "VnModel",
"mixins": {
"Loggable": true
},
"mixins": {
"Loggable": true
},
"options": {
"mysql": {
"table": "clientObservation"
@ -26,6 +26,10 @@
"created": {
"type": "date",
"description": "Creation date and time"
},
"observationTypeFk": {
"type": "number",
"description": "Type of observation"
}
},
"relations": {
@ -44,14 +48,18 @@
"include": {
"relation": "worker",
"scope": {
"fields": ["id"],
"fields": [
"id"
],
"include": {
"relation": "user",
"scope": {
"fields": ["nickname"]
"fields": [
"nickname"
]
}
}
}
}
}
}
}