diff --git a/db/changes/233401/01-deviceLog_acl.sql b/db/changes/233401/01-deviceLog_acl.sql new file mode 100644 index 000000000..ebe3f8ed5 --- /dev/null +++ b/db/changes/233401/01-deviceLog_acl.sql @@ -0,0 +1,6 @@ + +ALTER TABLE `vn`.`deviceLog` ADD serialNumber varchar(45) DEFAULT NULL NULL; + +INSERT INTO `salix`.`ACL` ( model, property, accessType, permission, principalType, principalId) +VALUES( 'DeviceLog', 'create', 'WRITE', 'ALLOW', 'ROLE', 'employee'); + diff --git a/modules/worker/back/model-config.json b/modules/worker/back/model-config.json index 60ec273a5..b261f895e 100644 --- a/modules/worker/back/model-config.json +++ b/modules/worker/back/model-config.json @@ -23,6 +23,9 @@ "Device": { "dataSource": "vn" }, + "DeviceLog": { + "dataSource": "vn" + }, "DeviceProduction": { "dataSource": "vn" }, diff --git a/modules/worker/back/models/device-log.json b/modules/worker/back/models/device-log.json new file mode 100644 index 000000000..9278b9038 --- /dev/null +++ b/modules/worker/back/models/device-log.json @@ -0,0 +1,40 @@ +{ + "name": "DeviceLog", + "base": "VnModel", + "options": { + "mysql": { + "table": "deviceLog" + } + }, + "properties": { + "id": { + "id": true, + "type": "number" + }, + "android_id": { + "type": "string" + }, + "userFk": { + "type": "number" + }, + "created": { + "type": "date" + }, + "nameApp": { + "type": "string" + }, + "versionApp": { + "type": "string" + }, + "deviceProductionFk": { + "type": "number" + } + }, + "relations": { + "user": { + "type": "belongsTo", + "model": "VnUser", + "foreignKey": "userFk" + } + } +}