- changed milestone to 0.5.xx
- changed title to Wrong syntax of "CREATE INDEX" for sqlite with schemas
It is tested with version 0.5.4p2 (and code is the same on the trunk). I have 2 databases attached to the session ('auth' and 'gate').
Here is the syntax of the "CREATE INDEX" statement:
* CREATE UNIQUE INDEX ix_auth_doom_users_login ON auth.doom_users (login)
[BR]
--> this is the wrong syntax generated by SQLAlchemy
* CREATE UNIQUE INDEX auth.ix_auth_doom_users_login ON doom_users (login)
[BR]
--> this is the syntax understood by SQLite
The "database-name" qualifier should be on the index name, not on the table name.
Reference: * http://www.sqlite.org/lang_createindex.html
Error stack:
File "/home/florent/.buildout/eggs/SQLAlchemy-0.5.4p2-py2.5.egg/sqlalchemy/schema.py", line 1786, in create_all
File "/home/florent/.buildout/eggs/SQLAlchemy-0.5.4p2-py2.5.egg/sqlalchemy/engine/base.py", line 1129, in create
File "/home/florent/.buildout/eggs/SQLAlchemy-0.5.4p2-py2.5.egg/sqlalchemy/engine/base.py", line 1158, in _run_visitor
File "/home/florent/.buildout/eggs/SQLAlchemy-0.5.4p2-py2.5.egg/sqlalchemy/sql/visitors.py", line 89, in traverse
File "/home/florent/.buildout/eggs/SQLAlchemy-0.5.4p2-py2.5.egg/sqlalchemy/sql/visitors.py", line 200, in traverse
File "/home/florent/.buildout/eggs/SQLAlchemy-0.5.4p2-py2.5.egg/sqlalchemy/sql/visitors.py", line 194, in traverse_using
File "/home/florent/.buildout/eggs/SQLAlchemy-0.5.4p2-py2.5.egg/sqlalchemy/sql/compiler.py", line 831, in visit_metadata
File "/home/florent/.buildout/eggs/SQLAlchemy-0.5.4p2-py2.5.egg/sqlalchemy/sql/visitors.py", line 79, in traverse_single
File "/home/florent/.buildout/eggs/SQLAlchemy-0.5.4p2-py2.5.egg/sqlalchemy/sql/compiler.py", line 874, in visit_table
File "/home/florent/.buildout/eggs/SQLAlchemy-0.5.4p2-py2.5.egg/sqlalchemy/sql/visitors.py", line 79, in traverse_single
File "/home/florent/.buildout/eggs/SQLAlchemy-0.5.4p2-py2.5.egg/sqlalchemy/sql/compiler.py", line 980, in visit_index
File "/home/florent/.buildout/eggs/SQLAlchemy-0.5.4p2-py2.5.egg/sqlalchemy/engine/base.py", line 1812, in execute
File "/home/florent/.buildout/eggs/SQLAlchemy-0.5.4p2-py2.5.egg/sqlalchemy/engine/base.py", line 824, in execute
File "/home/florent/.buildout/eggs/SQLAlchemy-0.5.4p2-py2.5.egg/sqlalchemy/engine/base.py", line 888, in _execute_text
File "/home/florent/.buildout/eggs/SQLAlchemy-0.5.4p2-py2.5.egg/sqlalchemy/engine/base.py", line 896, in __execute_context
File "/home/florent/.buildout/eggs/SQLAlchemy-0.5.4p2-py2.5.egg/sqlalchemy/engine/base.py", line 950, in _cursor_execute
File "/home/florent/.buildout/eggs/SQLAlchemy-0.5.4p2-py2.5.egg/sqlalchemy/engine/base.py", line 931, in _handle_dbapi_exception
OperationalError: (OperationalError) near ".": syntax error u'CREATE UNIQUE INDEX ix_auth_doom_users_login ON auth.doom_users (login)' ()