[web2py] Re: Table inheritance and migrations

2012-12-06 Thread Niphlod
happy to hear that... of course lazy_tables postpone the eventual migration at the first attempt of accessing it On Thursday, December 6, 2012 2:47:48 AM UTC+1, Joe Barnhart wrote: Wait! I figured it out! When lazy_tables=True the column structure is migrated only when the table is

[web2py] Re: Table inheritance and migrations

2012-12-05 Thread Niphlod
uhm: are you sure that adding unique=True gets the created index also in the parent table ? I think that the unique is enforced only on creation and not in migration (but the requires=IS_IN_DB() gets added anyway). In any case, what are you observing? (in other words, post a model and a

[web2py] Re: Table inheritance and migrations

2012-12-05 Thread Joe Barnhart
Ok, here is the setup. I have a table defined: db.define_table(xxx, Field(lastname,string,length=50,label=Last name,requires= IS_NOT_EMPTY() ), Field(firstname,string,length=50,label=First name,requires= IS_NOT_EMPTY() ), Field(middlename,string,length=50,label=Middle name ),

[web2py] Re: Table inheritance and migrations

2012-12-05 Thread Niphlod
thx. Just checked with stable and development, columns get migrated and a costraint is applied both to the parent and the child table On Wednesday, December 5, 2012 7:58:30 PM UTC+1, Joe Barnhart wrote: Ok, here is the setup. I have a table defined: db.define_table(xxx,

[web2py] Re: Table inheritance and migrations

2012-12-05 Thread Joe Barnhart
And I just tried again and it definitely did NOT add the constraint to the second table. Are you sure you added a constraint of unique=True? Maybe it depends on the type of constraint added (notnull, unique, etc.). -- Joe B. On Wednesday, December 5, 2012 12:25:51 PM UTC-8, Niphlod wrote:

[web2py] Re: Table inheritance and migrations

2012-12-05 Thread Joe Barnhart
Wait! I figured it out! When lazy_tables=True the column structure is migrated only when the table is built. Duh! I switched lazy_tables=False and it migrated table 2 as you experienced. Whew! I thought I was going crazy(er) for awhile! -- Joe B. On Wednesday, December 5, 2012 12:25:51