[web2py] Re: Associative Table
I don't believe so. Is there any reason you need to avoid that column? You should be able to disregard it fairly easily.
[web2py] Re: Associative Table
Check out http://web2py.com/books/default/chapter/29/6#Legacy-databases-and-keyed-tables -- probably not advisable. On Wednesday, February 15, 2012 7:16:59 PM UTC-5, Tom Nurkkala wrote: > > When creating a simple associative table between two (or more) other > tables, is there a way to tell web2py not to create the ID field? > > thanks, > tom.
[web2py] Re: Associative Table
Agree with the Anthony. Not advisable. On Feb 16, 9:19 am, Anthony wrote: > Check > outhttp://web2py.com/books/default/chapter/29/6#Legacy-databases-and-key... > -- probably not advisable. > > > > > > > > On Wednesday, February 15, 2012 7:16:59 PM UTC-5, Tom Nurkkala wrote: > > > When creating a simple associative table between two (or more) other > > tables, is there a way to tell web2py not to create the ID field? > > > thanks, > > tom.
[web2py] Re: Associative Table
Good practice says you should ALWAYS have an identity (ID) field, even if you don't use it.
[web2py] Re: Associative Table
If you want to avoid duplicate associations, check out update_or_insert. http://web2py.com/books/default/chapter/29/6#update_or_insert In raw SQL you would use the two associated IDs as the primary key, then use ON DUPLICATE KEY to trap the error. On Feb 16, 8:09 am, Ross Peoples wrote: > Good practice says you should ALWAYS have an identity (ID) field, even if > you don't use it.
[web2py] Re: Associative Table
On Feb 15, 8:14 pm, pbreit wrote: > I don't believe so. Is there any reason you need to avoid that column? You > should be able to disregard it fairly easily. Simply that it's not necessary to express a many-to-many relationship. It's not a big deal. Thanks for the feedback!