I suspect you have fake_migrate=True when you added the line:
Field('phone', label="Phone"),
Try the solution I just posted in the other thread. IF it does not work,
you can manually do the ALTER TABLE. web2py seems to already be aware of
those columns.
On Sunday, 22 July 2012 19:27:54 UTC-5, david.waldrop wrote:
>
> I create extra fields in auth_user like this
>
> ## create all tables needed by auth if not custom tables
> auth.settings.extra_fields['auth_user'] = [
> Field('org_ref', 'integer', label="Organization"),
> Field('phone', label="Phone"),
> Field('show1stpage', 'boolean', label="Show Getting Started Page"),
> Field('Invitedby', label="Invited By"),
> Field('RegistrationCode', label="Registration Code")
> ]
>
> ## create all tables needed by auth if not custom tables
> auth.define_tables(username=False, signature=False, Migrate=True)
>
>
> and am getting the following error after migrate. I have tried
> fake_migrate in all combinations.
> If i comments out the most recent fileds (i.e. the ones not in the current
> Postgres DB, the app will run, but blows up when I reference one of the new
> fields)
> If I add the fileds to the database directly (in the same order as the
> create table in the /databases/log.sql file, I get the error below
> Lastly I create a new table RegistrationCodes that is not getting created
> in the Postgres DB either. Its as if the migrate is not doing anything.
>
> 1.
> 2.
> 3.
> 4.
> 5.
> 6.
> 7.
> 8.
> 9.
> 10.
> 11.
> 12.
> 13.
> 14.
> 15.
> 16.
> 17.
> 18.
> 19.
> 20.
> 21.
> 22.
> 23.
>
> Traceback (most recent call last
> ):
> File "/home/dlwatey/webapps/web2py/web2py/gluon/restricted.py", line 205,
> in restricted
> exec ccode in environment
> File
> "/home/dlwatey/webapps/web2py/web2py/applications/COPSIS23/controllers/default.py"
> <https://www.copsis.org/admin/default/edit/COPSIS23/controllers/default.py>,
> line 226, in <module>
> File "/home/dlwatey/webapps/web2py/web2py/gluon/globals.py", line 175, in
> <lambda>
> self._caller = lambda f: f()
> File
> "/home/dlwatey/webapps/web2py/web2py/applications/COPSIS23/controllers/default.py"
> <https://www.copsis.org/admin/default/edit/COPSIS23/controllers/default.py>,
> line 85, in register
> inviterec = db((db.invite.id == request.args(0)) & (db.invite.host_ref ==
> db.auth_user.id)).select()
> File "/home/dlwatey/webapps/web2py/web2py/gluon/dal.py", line 8147, in
> select
> return adapter.select(self.query,fields,attributes)
> File "/home/dlwatey/webapps/web2py/web2py/gluon/dal.py", line 1410, in
> select
> rows = response(sql)
> File "/home/dlwatey/webapps/web2py/web2py/gluon/dal.py", line 1400, in
> response
> self.execute(sql)
> File "/home/dlwatey/webapps/web2py/web2py/gluon/dal.py", line 1489, in
> execute
> return self.log_execute(*a, **b)
> File "/home/dlwatey/webapps/web2py/web2py/gluon/dal.py", line 1483, in
> log_execute
> ret = self.cursor.execute(*a, **b)ProgrammingError: column
> auth_user.phone does not exist
> LINE 1: ...ey, auth_user.registration_id, auth_user.org_ref, auth_user....
> ^
>
>
> db = DAL('postgres://idxxx:[email protected]:5432/dlwatey_copsis',
> migrate_enabled=True, fake_migrate_all=False)
>
> I have tried the migrate=true, and fake_migrate flags but they are not
> working. I continue to see what is going on but am getting worried andmay
> have to revert to the old system.
>
--