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 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)) |
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 | |
import imp | |
from migrate.versioning import api | |
from app import db | |
from config import SQLALCHEMY_DATABASE_URI | |
from config import SQLALCHEMY_MIGRATE_REPO | |
v = api.db_version(SQLALCHEMY_DATABASE_URI, SQLALCHEMY_MIGRATE_REPO) | |
migration = SQLALCHEMY_MIGRATE_REPO + ('/versions/%03d_migration.py' % (v+1)) | |
tmp_module = imp.new_module('old_model') | |
old_model = api.create_model(SQLALCHEMY_DATABASE_URI, SQLALCHEMY_MIGRATE_REPO) |
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 api | |
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) |
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
npm install -g electron --unsafe-perm=true --allow-root |
NewerOlder