Created
November 26, 2013 08:29
-
-
Save olupotd/7655081 to your computer and use it in GitHub Desktop.
A simple commanding manager for your apps.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!flask/bin/python | |
from migrate.versioning import * | |
from config import SQLALCHEMY_DATABASE_URI | |
from config import SQLALCHEMY_MIGRATE_REPO | |
from app import db | |
import os.path | |
db.create_all() | |
if not os.path.exists(SQLALCHEMY_MIGRATE_REPO): | |
api.create(SQLALCHEMY_MIGRATE_REPO, 'database repository') | |
api.version_control(SQLALCHEMY_DATABASE_URI, SQLALCHEMY_MIGRATE_REPO) | |
else: | |
api.version_control(SQLALCHEMY_DATABASE_URI, SQLALCHEMY_MIGRATE_REPO, api.version(SQLALCHEMY_MIGRATE_REPO)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment