Guest User

Untitled

a guest
Oct 19th, 2013
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.47 KB | None | 0 0
  1. from migrate.versioning import api
  2. from config import SQLALCHEMY_DATABASE_URI
  3. from config import SQLALCHEMY_MIGRATE_REPO
  4. from app import db
  5. import os.path
  6. db.create_all()
  7. if not os.path.exists(SQLALCHEMY_MIGRATE_REPO):
  8.     api.create(SQLALCHEMY_MIGRATE_REPO, 'database repository')
  9.     api.version_control(SQLALCHEMY_DATABASE_URI, SQLALCHEMY_MIGRATE_REPO)
  10. else:
  11.     api.version_control(SQLALCHEMY_DATABASE_URI, SQLALCHEMY_MIGRATE_REPO, api.version(SQLALCHEMY_MIGRATE_REPO))
Advertisement
Add Comment
Please, Sign In to add comment