#996, new model personDepartment
This commit is contained in:
parent
9b1a52e47d
commit
7a879f5431
|
@ -43,5 +43,11 @@
|
||||||
},
|
},
|
||||||
"PersonMedia": {
|
"PersonMedia": {
|
||||||
"dataSource": "vn"
|
"dataSource": "vn"
|
||||||
}
|
},
|
||||||
}
|
"PersonDepartment": {
|
||||||
|
"dataSource": "vn"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
{
|
||||||
|
"name": "PersonDepartment",
|
||||||
|
"base": "VnModel",
|
||||||
|
"options": {
|
||||||
|
"mysql": {
|
||||||
|
"table": "personDepartment"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"properties": {
|
||||||
|
"name": {
|
||||||
|
"type": "String"
|
||||||
|
},
|
||||||
|
"firstName": {
|
||||||
|
"type": "String"
|
||||||
|
},
|
||||||
|
"workerFk": {
|
||||||
|
"id": true,
|
||||||
|
"type": "Number"
|
||||||
|
},
|
||||||
|
"department": {
|
||||||
|
"type": "Number"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"relations": {
|
||||||
|
"worker": {
|
||||||
|
"type": "belongsTo",
|
||||||
|
"model": "Worker",
|
||||||
|
"foreignKey": "workerFk"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -5,7 +5,7 @@ CREATE
|
||||||
SQL SECURITY DEFINER
|
SQL SECURITY DEFINER
|
||||||
VIEW `vn`.`personDepartment` AS
|
VIEW `vn`.`personDepartment` AS
|
||||||
SELECT
|
SELECT
|
||||||
`p`.`id_trabajador` AS `id_trabajador`,
|
`p`.`id_trabajador` AS `workerFk`,
|
||||||
`p`.`name` AS `name`,
|
`p`.`name` AS `name`,
|
||||||
`p`.`firstname` AS `firstname`,
|
`p`.`firstname` AS `firstname`,
|
||||||
`d`.`name` AS `department`
|
`d`.`name` AS `department`
|
||||||
|
|
Loading…
Reference in New Issue