tool_shed.webapp.model.migrate package



tool_shed.webapp.model.migrate.check module

tool_shed.webapp.model.migrate.check.create_or_verify_database(url, engine_options=None)[source]

Check that the database is useable, possibly creating it if empty (this is the only time we automatically create tables, otherwise we force the user to do it using the management script so they can create backups).

  1. Empty database –> initialize with latest version and return

  2. Database older than migration support –> fail and require manual update

  3. Database at state where migrate support introduced –> add version control information but make no changes (might still require manual update)

  4. Database versioned but out of date –> fail with informative message, user must run “sh upgrade”

tool_shed.webapp.model.migrate.check.migrate_to_current_version(engine, schema)[source]