diff options
author | Johannes Löthberg <johannes@kyriasis.com> | 2014-10-02 19:18:30 +0200 |
---|---|---|
committer | Johannes Löthberg <johannes@kyriasis.com> | 2014-10-02 19:18:30 +0200 |
commit | fb217ca2658c25f4df0a9b9b471ad85c608377a9 (patch) | |
tree | 7f6a34179a3824e3decab523b37d704f9ae9c213 /db_downgrade.py | |
download | tbt-fb217ca2658c25f4df0a9b9b471ad85c608377a9.tar.xz |
initial dump, sorta broken
Diffstat (limited to 'db_downgrade.py')
-rwxr-xr-x | db_downgrade.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/db_downgrade.py b/db_downgrade.py new file mode 100755 index 0000000..59200a9 --- /dev/null +++ b/db_downgrade.py @@ -0,0 +1,8 @@ +#!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)) |