my solution was to temporarily modify sql.py:_create() to always use
fake_migrate=True.
I found it is also necessary to set migrate=True or the .table files
will not be generated so you get the same error again as soon as
fake_migrate is set back to False.



On Feb 3, 10:15 am, Richard <richar...@gmail.com> wrote:
> I have a custom auth_user table but the rest are standard. I have
> added fake_migrate=True to my tables but web2py still complains about
> auth_group, etc. Is there a way to apply settings to these generated
> auth tables?
>
> On Feb 3, 1:42 am, mdipierro <mdipie...@cs.depaul.edu> wrote:
>
> > Do you have a custom auth_table?
>
> > If so you can do:
>
> >   db.define_table('auth_table',....,migarte=False,make_migrate=True)
>
> > Then you have to check in SQL that all columns you expect are there.
>
> > massimo
>
> > On Feb 2, 2:56 am, Richard <richar...@gmail.com> wrote:
>
> > > Some of my .table files have become corrupted, so that I get this
> > > error:
>
> > > Traceback (most recent call last):
> > >   File "web2py/gluon/restricted.py", line 178, in restricted
> > >     exec ccode in environment
> > >   File "web2py/applications/studio09/models/db.py", line 165, in
> > > <module>
> > >     Field('video', db.media),
> > >   File "web2py/gluon/sql.py", line 1033, in define_table
> > >     query = t._create(migrate=migrate)
> > >   File "web2py/gluon/sql.py", line 1393, in _create
> > >     sql_fields_old = cPickle.load(tfile)
> > > EOFError
>
> > > However if I remove the .table files then I get this error:
>
> > > Traceback (most recent call last):
> > >   File "web2py/gluon/restricted.py", line 178, in restricted
> > >     exec ccode in environment
> > >   File "web2py/applications/studio09/models/db.py", line 28, in
> > > <module>
> > >     Field('registration_key', length=128, readable=False,
> > > writable=False, default=''),
> > >   File "web2py/gluon/sql.py", line 1033, in define_table
> > >     query = t._create(migrate=migrate)
> > >   File "web2py/gluon/sql.py", line 1368, in _create
> > >     self._db._execute(query)
> > >   File "web2py/gluon/sql.py", line 704, in <lambda>
> > >     self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
> > > OperationalError: table auth_user already exists
>
> > > Is there a way to restore my .table files without having to export my
> > > data, drop the tables, and then reimport later?
>
> > > thanks,
> > > Richard
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.

Reply via email to