that's why web2py is trying to create a table on your database. let's try this.... db = DAL(....., fake_migrate=True) #auth.extra_fields['....'] =
auth.define_tables(fake_migrate=True) this will recreate the relevant file. Be sure to comment out your extra_fields definition so the fake migration just recreates the table file that is "equal" to what you have in your database (an auth_user table WITHOUT the extra field). Jump on the database administration page, so all tables are fake_migrated correctly. Now, web2py has a "consistent" status of what your tables are at all effects on your database, and you can trigger the addition of the new column. db = DAL(....., migrate=True) auth.extra_fields['...'] = ..... auth.define_tables(migrate=True) Hit the appadmin page again, and you should have your extra column. Let us know if there are still problems On Monday, June 10, 2013 9:21:03 PM UTC+2, Andre Kozaczka wrote: > > Correct, I do *not* have that file in the databases folder. > > On Monday, June 10, 2013 3:16:42 PM UTC-4, Niphlod wrote: >> >> so probably you don't have an *_auth_user.table in the databases/* >> folder. Can you confirm ? >> >> On Monday, June 10, 2013 6:38:18 PM UTC+2, Andre Kozaczka wrote: >>> >>> Tried step 1. I get the same 'auth_user' table already exists. >>> >>> <class 'gluon.contrib.pymysql.err.InternalError'> (1050, u"Table >>> 'auth_user' already exists") >>> >>> Step 2 gave the same error. Seems like whenever migrate is set to True >>> when define_tables is run, I'm getting the table already exists error. >>> >>> On Monday, June 10, 2013 12:18:17 PM UTC-4, Massimo Di Pierro wrote: >>>> >>>> Try, in order: >>>> >>>> 1) >>>> >>>> db = DAL(...,fake_migrate=True) >>>> ... >>>> # auth.settings.extra_fields['auth_user'] = [Field('eft', 'integer')] >>>> auth.define_tables(migrate=True) >>>> >>>> run appadmin. >>>> >>>> 2) >>>> db = DAL(...) >>>> ... >>>> auth.settings.extra_fields['auth_user'] = [Field('eft', 'integer')] >>>> auth.define_tables(migrate=True) >>>> >>>> run appadmin again. >>>> >>>> >>>> On Monday, 10 June 2013 10:52:26 UTC-5, Andre Kozaczka wrote: >>>>> >>>>> Also, to clarify.... I'm trying to add this column after I've done >>>>> some development and already had an auth_user table created... don't >>>>> think >>>>> this should matter, but wanted to throw this out there. Maybe I need to >>>>> manually drop the MySQL table and then see if the migration works with >>>>> the >>>>> added column...? >>>>> >>>>> On Friday, June 7, 2013 3:12:29 PM UTC-4, Niphlod wrote: >>>>>> >>>>>> The "column not found" is your "eft" one ? >>>>>> You code seems legit (setting migrate=True on the define_tables() >>>>>> function). We need to see the errors and the definition that causes them. >>>>>> >>>>>> On Friday, June 7, 2013 7:29:12 PM UTC+2, Andre Kozaczka wrote: >>>>>>> >>>>>>> I'm trying to modify the auth_user table and I keep either getting a >>>>>>> Table 'auth_user' already exist error (when migrate=True) OR a 'Column >>>>>>> not >>>>>>> found' (when migrate=False). Not sure what I need to do. >>>>>>> >>>>>>> I've also tried experimenting with fake_migrate but I'm still >>>>>>> getting either one of those errors. >>>>>>> >>>>>>> Here is my code: >>>>>>> db = DAL(settings.db_uri, pool_size=20) >>>>>>> >>>>>>> >>>>>>> crud = Crud(globals(), db) >>>>>>> auth = Auth(globals(), db) >>>>>>> >>>>>>> auth.settings.actions_disabled.append('register') >>>>>>> auth.settings.extra_fields['auth_user'] = [Field('eft', 'integer')] >>>>>>> >>>>>>> auth.define_tables(migrate=True) >>>>>>> >>>>>>> >>>>>>> -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.