I manually defined the auth tables. However, system is now saying auth_user already exist.
<class 'fdb.fbcore.DatabaseError'> ('Error while executing SQL statement:\n- SQLCODE: -607\n- unsuccessful metadata update\n- Table AUTH_USER already exists', -607, 335544351)
Version
web2py™ Version 2.7.4-stable+timestamp.2013.10.14.15.16.29
Python Python 2.7.5: c:\python27\python.exe (prefix: c:\python27)
Traceback
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 "C:\web2py_src\web2py\gluon\restricted.py", line 217, in restricted
exec ccode in environment
File "C:/web2py_src/web2py/applications/unionhall/models/db.py", line 19, in <module>
primarykey=['id']
File "C:\web2py_src\web2py\gluon\dal.py", line 7935, in define_table
table = self.lazy_define_table(tablename,*fields,**args)
File "C:\web2py_src\web2py\gluon\dal.py", line 7972, in lazy_define_table
polymodel=polymodel)
File "C:\web2py_src\web2py\gluon\dal.py", line 1002, in create_table
self.create_sequence_and_triggers(query,table)
File "C:\web2py_src\web2py\gluon\dal.py", line 3684, in create_sequence_and_triggers
self.execute(query)
File "C:\web2py_src\web2py\gluon\dal.py", line 1836, in execute
return self.log_execute(*a, **b)
File "C:\web2py_src\web2py\gluon\dal.py", line 1830, in log_execute
ret = self.cursor.execute(command, *a[1:], **b)
File "c:\python27\lib\site-packages\fdb-1.4-py2.7.egg\fdb\fbcore.py", line 3323, in execute
self._ps._execute(parameters)
File "c:\python27\lib\site-packages\fdb-1.4-py2.7.egg\fdb\fbcore.py", line 3024, in _execute
"Error while executing SQL statement:")
DatabaseError: ('Error while executing SQL statement:\n- SQLCODE: -607\n- unsuccessful metadata update\n- Table AUTH_USER already exists', -607, 335544351)
Error snapshot help
<class 'fdb.fbcore.DatabaseError'>(('Error while executing SQL statement:\n- SQLCODE: -607\n- unsuccessful metadata update\n- Table AUTH_USER already exists', -607, 335544351))
I'm really close to finishing this up. Just need to get auth working correctly, replace the password field since its a reserved word in Firebird. Also need to figure out what to do with the Role field in auth_group because firebird used "role" for something. I had to create field called au_group_role. But don't know how to integrate that into web2py auth scheme.
db.define_table('auth_user',
Field('id', 'integer', notnull=True),
Field('first_name', 'string', length=128),
Field('last_name', 'string', length=128),
Field('email', 'string', length=512),
Field('registration_key', 'string', length=512),
Field('reset_password_key', 'string', length=512),
primarykey=['id']
)
db.define_table('auth_group',
Field('id', 'integer', notnull=True),
Field('au_grp_role', 'string', length=512),
Field('description', 'text'),
primarykey=['id'])
auth.settings.password_field = 'passwrd' # In Firebird password is a reserved word; so using passwrd instead