add new model clientRisk
This commit is contained in:
parent
a681f6f854
commit
b6ac4ff900
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"name": "ClientRisk",
|
||||
"base": "VnModel",
|
||||
"options": {
|
||||
"mysql": {
|
||||
"table": "clientRisk",
|
||||
"database": "vn"
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"amount": {
|
||||
"type": "Number"
|
||||
}
|
||||
},
|
||||
"relations": {
|
||||
"client": {
|
||||
"type": "belongsTo",
|
||||
"model": "Client",
|
||||
"foreignKey": "clientFk"
|
||||
},
|
||||
"company": {
|
||||
"type": "belongsTo",
|
||||
"model": "Company",
|
||||
"foreignKey": "companyFk"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -55,5 +55,8 @@
|
|||
},
|
||||
"Defaulter": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"ClientRisk": {
|
||||
"dataSource": "vn"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
USE `vn`;
|
||||
CREATE
|
||||
OR REPLACE ALGORITHM = UNDEFINED
|
||||
DEFINER = `root`@`%`
|
||||
SQL SECURITY DEFINER
|
||||
VIEW `clientRisk` AS
|
||||
SELECT
|
||||
`c`.`customer_id` AS `clientFk`,
|
||||
`c`.`company_id` AS `companyFk`,
|
||||
`c`.`amount` AS `amount`
|
||||
FROM
|
||||
`bi`.`customer_risk` `c`;
|
Loading…
Reference in New Issue