dresende / node-orm2

Object Relational Mapping
http://github.com/dresende/node-orm2
MIT License
3.07k stars 379 forks source link

singular/plural field names on many to many #634

Open shaishf opened 9 years ago

shaishf commented 9 years ago

Hi,

i'm having a small problems using this (wonderful) library.

i've created a self-referenced many to many relationship:

var Profile = db.define("profiles", { name: {type: "text", required: true}, ... }.hasMany('connections',models.Profile,{ },{ reverse: 'added', key: true },{key:true})

this works great. however , on the created table after sync, the field names are profiles_id, and connections_id - is it possible to make them into "profile_id" and "connection_id" instead? this will make the library compatible with other ORMs such as rails.

Thanks!!

Bludwarf commented 8 years ago

Hi, I have the same problem too. It creates a plural column instead of a singular one. Thank you again for this great module !