dresende/node-orm2 — pull request #227 by SPARTAN563 (2013-07-15 14:20:37+00:00)
Title: Intelligent association typing and multikey support

## Added Functionality
A current issue with node-orm2 is the inability of it to intelligently type foreign key columns in the database, this change set makes it impossible to use it on data sets which use non-default identifier key types. For example, using a person's username as the ID field on a table will currently ignore the username's field type and create `INT(11) UNSIGNED NOT NULL` foreign keys when attempting to reference it for `hasOne()`, `hasMany()` and `extendsTo()`.

This change set should make it possible for node-orm2 to automatically create foreign keys of the correct type for such references.

The second part of this change set is the implementation of support for multiple primary keys on a table (defined by `id: [...]` in a table's definition), and allows node-orm2 to automatically create multiple foreign key references for tables with multiple primary keys.

## Breaking Changes
There is a change in the way chained finds are executed for hasAccessors, meaning that instead of passing the id of the object you pass the entire object. This is to support objects with multiple primary key identifiers. The test which highlights this has been updated to match the new protocol.

```js
Model.find().hasSomething(TheSomething).all(function(err, somethings) {

});
```