Closed danfinlay closed 9 years ago
Oh silly me, I should be using the int
type.
Actually, this DOES seem to be a problem. If I force a data-type to INTEGER, it doesn't really matter, because all Model has is a belongsTo
, not an integer
declaration, since it's just a relationship, not an attribute. And when the results come back, even from a query that returns valid SQL results, Model seems to be dropping results that don't have "expected" data types.
Maybe I can set an attribute that is also used as a belongsTo
key, and it will force the data type..
Sorry, long day, I think I was trolling myself :P
Is there a way to choose other number types for the Postgres adapter?
Currently if I create a migration or scaffold a column to use the type
number
,Model
creates aPostgres
column of typereal
.This is maybe a good general choice, but when my columns can represent relational IDs (the way they do when using
autoIncrementId = true
in the config), this means imprecise relationships!This took me a while to debug. I think I'm going to just set the data types manually for the moment, but is there a way to dictate number types within model in the future?