Hi all,

Since SQLAlchemy 0.4.1, I cannot create my database anymore on mssql
only (mysql and sqlite are fine).
The error is the following :

  File "/usr/lib/python2.4/site-packages/SQLAlchemy-0.4.1-py2.4.egg/
sqlalchemy/databases/mssql.py", line 945, in get_column_specification
    if (not getattr(column.table, 'has_sequence', False)) and
column.primary_key and \
AttributeError: 'Column' object has no attribute 'foreign_key'

It seems that the mssql backend use a 'foreign_key' attribute on
Column which does not exist anymore.

How should this information be checked on a Column ?

Regards,

Christophe de Vienne


PS : More complete trace :
  File "/usr/lib/python2.4/site-packages/SQLAlchemy-0.4.1-py2.4.egg/
sqlalchemy/schema.py", line 303, in create
    self.metadata.create_all(bind=bind, checkfirst=checkfirst,
tables=[self])
  File "/usr/lib/python2.4/site-packages/SQLAlchemy-0.4.1-py2.4.egg/
sqlalchemy/schema.py", line 1232, in create_all
    bind.create(self, checkfirst=checkfirst, tables=tables)
  File "/usr/lib/python2.4/site-packages/SQLAlchemy-0.4.1-py2.4.egg/
sqlalchemy/engine/base.py", line 1052, in create
    self._run_visitor(self.dialect.schemagenerator, entity,
connection=connection, **kwargs)
  File "/usr/lib/python2.4/site-packages/SQLAlchemy-0.4.1-py2.4.egg/
sqlalchemy/engine/base.py", line 1082, in _run_visitor
    visitorcallable(self.dialect, conn, **kwargs).traverse(element)
  File "/usr/lib/python2.4/site-packages/SQLAlchemy-0.4.1-py2.4.egg/
sqlalchemy/sql/visitors.py", line 79, in traverse
    meth(target)
  File "/usr/lib/python2.4/site-packages/SQLAlchemy-0.4.1-py2.4.egg/
sqlalchemy/sql/compiler.py", line 761, in visit_metadata
    self.traverse_single(table)
  File "/usr/lib/python2.4/site-packages/SQLAlchemy-0.4.1-py2.4.egg/
sqlalchemy/sql/visitors.py", line 30, in traverse_single
    return meth(obj, **kwargs)
  File "/usr/lib/python2.4/site-packages/SQLAlchemy-0.4.1-py2.4.egg/
sqlalchemy/sql/compiler.py", line 780, in visit_table
    self.append("\t" + self.get_column_specification(column,
first_pk=column.primary_key and not first_pk))
  File "/usr/lib/python2.4/site-packages/SQLAlchemy-0.4.1-py2.4.egg/
sqlalchemy/databases/mssql.py", line 945, in get_column_specification
    if (not getattr(column.table, 'has_sequence', False)) and
column.primary_key and \
AttributeError: 'Column' object has no attribute 'foreign_key'

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to