Added new SQL version
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Joan Sanchez 2022-10-24 18:37:38 +02:00
parent 04be661b68
commit e80754f280
8 changed files with 59 additions and 4 deletions

View File

@ -0,0 +1,5 @@
INSERT INTO `salix`.`ACL` (model, property, accessType, permission, principalType, principalId)
VALUES
('ClaimRma', '*', 'READ', 'ALLOW', 'ROLE', 'claimManager'),
('ClaimRma', '*', 'WRITE', 'ALLOW', 'ROLE', 'claimManager');

View File

@ -0,0 +1 @@
ALTER TABLE `vn`.`claim` ADD rma varchar(100) NULL ;

View File

@ -0,0 +1,7 @@
CREATE TABLE `vn`.`claimRma` (
id INT UNSIGNED auto_increment NOT NULL PRIMARY KEY,
code varchar(100) NOT NULL,
created timestamp DEFAULT current_timestamp() NOT NULL,
workerFk INTEGER UNSIGNED NOT NULL
)
ENGINE=InnoDB;

View File

@ -47,7 +47,7 @@ module.exports = Self => {
{ {
relation: 'claimState', relation: 'claimState',
scope: { scope: {
fields: ['id', 'description'] fields: ['id', 'code', 'description']
} }
}, },
{ {

View File

@ -2,6 +2,9 @@
"Claim": { "Claim": {
"dataSource": "vn" "dataSource": "vn"
}, },
"ClaimContainer": {
"dataSource": "claimStorage"
},
"ClaimBeginning": { "ClaimBeginning": {
"dataSource": "vn" "dataSource": "vn"
}, },
@ -41,7 +44,7 @@
"ClaimObservation": { "ClaimObservation": {
"dataSource": "vn" "dataSource": "vn"
}, },
"ClaimContainer": { "ClaimRma": {
"dataSource": "claimStorage" "dataSource": "vn"
} }
} }

View File

@ -0,0 +1,30 @@
{
"name": "ClaimRma",
"base": "VnModel",
"options": {
"mysql": {
"table": "claimRma"
}
},
"properties": {
"id": {
"type": "number",
"id": true,
"description": "Identifier"
},
"code": {
"type": "string",
"required": true
},
"created": {
"type": "date"
}
},
"relations": {
"worker": {
"type": "belongsTo",
"model": "worker",
"foreignKey": "workerFk"
}
}
}

View File

@ -46,6 +46,9 @@
}, },
"packages": { "packages": {
"type": "number" "type": "number"
},
"rma": {
"type": "string"
} }
}, },
"relations": { "relations": {
@ -54,6 +57,12 @@
"model": "ClaimState", "model": "ClaimState",
"foreignKey": "claimStateFk" "foreignKey": "claimStateFk"
}, },
"claimRma": {
"type": "belongsTo",
"model": "ClaimRma",
"foreignKey": "rma",
"primaryKey": "code"
},
"client": { "client": {
"type": "belongsTo", "type": "belongsTo",
"model": "Client", "model": "Client",