I have a pair of tables (MySQL, if you're curious) such that one is a primary table and one is an auxiliary table whose PK is an FK to the first one -- they share a one-to-one relationship.
I've defined both tables adequately, but I run into trouble when I attempt to define the primary table's model to refer to the secondary. Specifically, all attempts to do /this/ fail:
/* existing primary key defined, works okay */
id: {
columnName: 'KeyID',
type: 'integer',
primaryKey: 'true',
autoIncrement: 'true'
},
/* adding this ruins everything */
moreData: {
columnName: 'KeyID',
model: 'extraData'
}
Running this sees the ORM /return/ but the results are strange and corrupt, with KeyID being a copy of what moreData should be, and moreData being a strange array with DB fields and not properly rename attributes. Excluding the columnName sees the query fail because moreData isn't in the primary table's field list.
Am I approaching this incorrectly?