#9699 update structure and create new model
This commit is contained in:
parent
84c0002cb1
commit
e1207edb95
|
@ -37,6 +37,9 @@
|
|||
},
|
||||
"Vehicle": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"UserTableConfiguration": {
|
||||
"dataSource": "vn"
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
"name": "UserTableConfiguration",
|
||||
"base": "VnModel",
|
||||
"options": {
|
||||
"mysql": {
|
||||
"table": "salix.userTableConfiguration"
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"id": {
|
||||
"id": true,
|
||||
"type": "Number",
|
||||
"required": true
|
||||
},
|
||||
"tableCode": {
|
||||
"type": "String",
|
||||
"required": true
|
||||
},
|
||||
"configuration": {
|
||||
"type": "String"
|
||||
}
|
||||
},
|
||||
"relations": {
|
||||
"worker": {
|
||||
"type": "belongsTo",
|
||||
"model": "Worker",
|
||||
"foreignKey": "workerFk"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
CREATE TABLE `salix`.`userTableConfiguration` (
|
||||
`id` INT NOT NULL AUTO_INCREMENT,
|
||||
`workerFk` INT(11) NOT NULL,
|
||||
`tableCode` VARCHAR(255) NOT NULL,
|
||||
`configuration` TEXT NULL,
|
||||
PRIMARY KEY (`id`));
|
||||
|
||||
|
||||
|
||||
|
||||
ALTER TABLE `salix`.`userTableConfiguration`
|
||||
ADD INDEX `fgn_worker_idx` (`workerFk` ASC);
|
||||
ALTER TABLE `salix`.`userTableConfiguration`
|
||||
ADD CONSTRAINT `fgn_worker`
|
||||
FOREIGN KEY (`workerFk`)
|
||||
REFERENCES `vn2008`.`Trabajadores` (`Id_Trabajador`)
|
||||
ON DELETE CASCADE
|
||||
ON UPDATE CASCADE;
|
Loading…
Reference in New Issue