Attempting to use sqlalchemy-migrate 0.5.4. Google is no help on the error
below:
$ python schema_migration/manage.py test
Traceback (most recent call last):
File "schema_migration/manage.py", line 2, in <module>
from migrate.versioning.shell import main
File
"/Users/gisborne/Documents/iparq/tg2env/lib/python2.6/site-packages/sqlalchemy_migrate-0.5.4-py2.6.egg/migrate/versioning/shell.py",
line 7, in <module>
from migrate.versioning.base import *
File
"/Users/gisborne/Documents/iparq/tg2env/lib/python2.6/site-packages/sqlalchemy_migrate-0.5.4-py2.6.egg/migrate/versioning/base/__init__.py",
line 5, in <module>
from const import databases,operations
File
"/Users/gisborne/Documents/iparq/tg2env/lib/python2.6/site-packages/sqlalchemy_migrate-0.5.4-py2.6.egg/migrate/versioning/base/const.py",
line 7, in <module>
from sqlalchemy.util import OrderedDict
ImportError: No module named sqlalchemy.util
Here is the migration I am trying to add:
from sqlalchemy import *
from migrate import *
metadata = MetaData(migrate_engine)
users_table = Table("tg_user", metadata,
Column("user_id", Integer, autoincrement=True,
primary_key=True),
Column("user_name", Unicode(16), unique=True,
nullable=False),
Column("email_address", Unicode(255), unique=True,
nullable=False, info={'rum': {'field':'Email'}}),
Column("display_name", Unicode(255)),
Column("password", Unicode(80), info={'rum':
{'field':'Password'}}),
Column("created", DateTime, default=datetime.now),
Column("account_id", Integer, ForeignKey('accounts.id')))
column = Column("activated", DateTime)
def upgrade():
# Upgrade operations go here. Don't create your own engine; use the engine
# named 'migrate_engine' imported from migrate.
column.create(users_table)
def downgrade():
# Operations to reverse the above upgrade go here.
users_table.activated.drop()
Also, there doesn't appear to be a whole lot of documentation on migrations. Am
I right in thinking that I need to copy the extant table definition into a
migration before I can modify it? Is there a good reason for that?
--
You received this message because you are subscribed to the Google Groups
"TurboGears" 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/turbogears?hl=en.