1
0
Fork 0
mirror of https://gitlab.com/SIGBUS/nyaa.git synced 2024-11-14 17:09:14 +00:00
nyaa/db_migrate.py

22 lines
439 B
Python
Raw Normal View History

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
from flask_script import Manager
from flask_migrate import Migrate, MigrateCommand
from nyaa import create_app
from nyaa.extensions import db
app = create_app('config')
migrate = Migrate(app, db)
manager = Manager(app)
manager.add_command("db", MigrateCommand)
if __name__ == "__main__":
# Patch sys.argv to default to 'db'
sys.argv.insert(1, 'db')
manager.run()