Hi,
I have noticed some strange behaviour in some of our data models.
We have a Customer Model which has the following numeric properties:
id: bigint
branding_id: integer
reseller_id: bigint
When querying for a Customer the following is returned:
{- id: 1,
- resellerId: "1",
- customerName: "ACME Corp",
- addressId: null,
- created: "2010-07-01T06:41:38.000Z",
- modified: "2010-07-01T06:41:38.000Z",
- approved: "2012-10-24T21:37:04.067Z",
- active: true,
- brandingId: 1,
- measurement: "Imperial",
- eula: null
}
Despite the id and resellerID's being the same datatype in the database (biging), one comes back as numeric and the other comes back as string. Also, brandingID defined as an integer in the db returns as a numeric whereas resellerID returns as strings?
This is really frustrating. Can you please explain this behaviour? Is it something related to our model definition? Here are the three field definitions:
"id": {
"type": "Number",
"id": true,
"required": true,
"index": true,
"length": null,
"precision": 64,
"scale": 0,
"postgresql": {
"columnName": "id",
"dataType": "bigint",
"dataLength": null,
"dataPrecision": 64,
"dataScale": 0,
"nullable": "NO"
}
},
"resellerId": {
"type": "Number",
"required": false,
"length": null,
"precision": 32,
"scale": 0,
"postgresql": {
"columnName": "reseller_id",
"dataType": "bigint",
"dataLength": null,
"dataPrecision": 32,
"dataScale": 0,
"nullable": "YES"
}
},
"brandingId": {
"type": "Number",
"required": false,
"length": null,
"precision": 32,
"scale": 0,
"postgresql": {
"columnName": "branding_id",
"dataType": "integer",
"dataLength": null,
"dataPrecision": 32,
"dataScale": 0,
"nullable": "YES"
}
}
Any help on this is greatly appreciated.
Thank you.