Niphlod,

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'])

attempting to use this line to deal with auth_user.password field
auth.settings.password_field = 'passwrd' # In Firebird password is a 
reserved word; so using passwrd instead

What can I do about auth_group.role?  

Thoughts?



On Sunday, November 10, 2013 6:46:33 AM UTC-6, Niphlod wrote:
>
> Very strange, since fdb is included as an adapter for some time now. I 
> guess firebird adoption is definitely not widespread.
> This should be addressed in DAL at creation time. 
> Can you provide the syntax that web2py should use vs the sintax that it 
> actually uses ? Maybe open a ticket on google code so it doesn't get lost. 
>
> On Sunday, November 10, 2013 4:19:28 AM UTC+1, GregD wrote:
>>
>> Niphlod,
>>
>> Thanks for the response.  I understand it better now.  
>>
>> web2py generates this message
>> DatabaseError: ('Error while executing SQL statement:\n- SQLCODE: -607\n- 
>> unsuccessful metadata update\n- Column: ID not defined as NOT NULL - cannot 
>> be used in PRIMARY KEY constraint definition', -607, 335544
>>
>> I think its because its trying to create a table with ID as primary key, 
>> but it does not include NOT NULL in the creation of the table.
>>
>> this is from the sql.log file:
>> CREATE TABLE auth_user(
>>     id INTEGER PRIMARY KEY,
>>     first_name VARCHAR(128),
>>     last_name VARCHAR(128),
>>     email VARCHAR(512),
>>     username VARCHAR(128),
>>     passwrd VARCHAR(512),
>>     registration_key VARCHAR(512),
>>     reset_password_key VARCHAR(512),
>>     registration_id VARCHAR(512)
>> );
>>
>> firebird will not allow this create statement unless it has NOT NULL 
>> added.
>>
>>
>> On Saturday, November 9, 2013 7:00:13 AM UTC-6, Niphlod wrote:
>>>
>>> web2py definitely needs the auth tables to work with any auth backend 
>>> (even LDAP).
>>> Of course username and pwd are stored in AD, but AD doesn't have, e.g, 
>>> the user id.
>>> web2py uses auth_* tables for dealing with RBAC, and even if you don't 
>>> need granular permissions, groups etc, it still has to map a user to a 
>>> unique integer(ish) id.
>>> Moreover, auth_* tables assure you that you won't continuously hit the 
>>> auth backend once authenticated (sort of a "cached" copy of what is needed 
>>> is written into the database).
>>>
>>> You shouldn't have problems with firebird .... what is the exception 
>>> your app raises when trying to create the auth tables ?
>>>
>>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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.

Reply via email to