Skip to content

Instantly share code, notes, and snippets.

@olupotd
Created November 26, 2013 08:29
Show Gist options
  • Save olupotd/7655081 to your computer and use it in GitHub Desktop.
Save olupotd/7655081 to your computer and use it in GitHub Desktop.
A simple commanding manager for your apps.
#!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