Opened 10 years ago

Closed 10 years ago

#982 closed defect (fixed)

Database migrations no longer work

Reported by: Jessica Tallon Owned by:
Priority: critical Milestone: 0.8.0
Component: programming Keywords: migration, database
Cc: Parent Tickets:

Description

Since the python 3 merge, database migrations no longer work. To produce the error you should run ./devtools/make_example_database.sh on the latest master (as of writing this it's 1a2982d) to produce a un-migrated database. Then do ./bin/gmg dbupdate you will find an error will occur:

-> Updating main mediagoblin tables:
   + Running migration 19, "drop_MediaEntry_collected"... Traceback (most recent call last):
  File "./bin/gmg", line 9, in <module>
    load_entry_point('mediagoblin==0.7.2.dev', 'console_scripts', 'gmg')()
  File "/Users/jessica/Documents/Workspace/mediagoblin/mediagoblin/gmg_commands/__init__.py", line 130, in main_cli
    args.func(args)
  File "/Users/jessica/Documents/Workspace/mediagoblin/mediagoblin/gmg_commands/dbupdate.py", line 160, in dbupdate
    run_dbupdate(app_config, global_config)
  File "/Users/jessica/Documents/Workspace/mediagoblin/mediagoblin/gmg_commands/dbupdate.py", line 128, in run_dbupdate
    run_all_migrations(db, app_config, global_config)
  File "/Users/jessica/Documents/Workspace/mediagoblin/mediagoblin/gmg_commands/dbupdate.py", line 155, in run_all_migrations
    migration_manager.init_or_migrate()
  File "/Users/jessica/Documents/Workspace/mediagoblin/mediagoblin/db/migration_tools.py", line 286, in init_or_migrate
    migration_func(self.session)
  File "/Users/jessica/Documents/Workspace/mediagoblin/mediagoblin/db/migrations.py", line 724, in drop_MediaEntry_collected
    media_collected.drop()
  File "build/bdist.macosx-10.9-x86_64/egg/sqlalchemy/sql/expression.py", line 2855, in __getattr__
AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'drop'

The version of SQLAlchemy that I'm using is: 0.8.7

Change History (1)

comment:1 by Christopher Allan Webber, 10 years ago

Milestone: 0.8.0
Resolution: fixed
Status: newclosed

Should be fixed now in git master!

Note: See TracTickets for help on using tickets.