Skip to content

Instantly share code, notes, and snippets.

@anshumanv
Created November 26, 2017 19:32
Show Gist options
  • Save anshumanv/b22717181dc7583615d4438ca656b859 to your computer and use it in GitHub Desktop.
Save anshumanv/b22717181dc7583615d4438ca656b859 to your computer and use it in GitHub Desktop.
#!flask/bin/python
from migrate.versioning import api
from config import SQLALCHEMY_DATABASE_URI
from config import SQLALCHEMY_MIGRATE_REPO
v = api.db_version(SQLALCHEMY_DATABASE_URI, SQLALCHEMY_MIGRATE_REPO)
api.downgrade(SQLALCHEMY_DATABASE_URI, SQLALCHEMY_MIGRATE_REPO, v - 1)
v = api.db_version(SQLALCHEMY_DATABASE_URI, SQLALCHEMY_MIGRATE_REPO)
print('Current database version: ' + str(v))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment