On May 17, 6:31 pm, drayco <[email protected]> wrote: > Hi, I updated my web2py, but I had a problem with web2py 1.78.3, I use > legacy databases. When I try to go to my application I got this > > Error traceback > > Traceback (most recent call last): > File "/media/RESPALDO/web2py/gluon/restricted.py", line 178, in > restricted > exec ccode in environment > File "/media/RESPALDO/web2py/applications/scada/models/ > calenergy.py", line 8, in <module> > migrate = False) > File "/media/RESPALDO/web2py/gluon/sql.py", line 1296, in > define_table > **dict(primarykey=args['primarykey'], trigger_name=trigger_name, > sequence_name=sequence_name)) > File "/media/RESPALDO/web2py/gluon/sql.py", line 2115, in __init__ > raise SyntaxError, 'invalid table "%s" attribute: %s' % > (tablename, k) > SyntaxError: invalid table "area" attribute: sequence_name > > In file: /media/RESPALDO/web2py/applications/scada/models/calenergy.py > > calenergy=SQLDB('mysql://xxx:[email protected]:3306/xxx',pool_size=10) > > calenergy.define_table('area', > Field('clave', type = 'char' , length = 3 ), > Field('IdZona', type = 'integer' , length = 10 ), > Field('nombre', type = 'string' , length = 50 ), > primarykey=['clave','IdZona'], > migrate = False) > > Even with web2py 1.77.3. > > What this mean? > > with my older version of web2py, I work well.
I am surprised to hear that it did work before because mysql is not one of the supported DBs for legacy tables; only DB2, MS SQL, Ingres or Informix. But adding the support for them is not hard, you can follow the instructions given in section E (the last section) of http://groups.google.com/group/web2py/msg/c9848792a8999c5f same with any other unsupported DB engine, except sqlite which I believe lacks the required foreign keys constructs. Denes.

