2017-05-27 14:43:27 +00:00
|
|
|
#!/usr/bin/env python3
|
2017-05-21 15:47:16 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
2017-05-27 20:19:38 +00:00
|
|
|
import sys
|
2017-07-30 17:35:16 +00:00
|
|
|
|
2017-05-21 15:47:16 +00:00
|
|
|
from flask_script import Manager
|
|
|
|
from flask_migrate import Migrate, MigrateCommand
|
|
|
|
|
2017-08-01 18:02:08 +00:00
|
|
|
from nyaa import create_app
|
2017-07-30 17:35:16 +00:00
|
|
|
from nyaa.extensions import db
|
|
|
|
|
2017-08-01 18:02:08 +00:00
|
|
|
app = create_app('config')
|
2017-05-21 15:47:16 +00:00
|
|
|
migrate = Migrate(app, db)
|
|
|
|
|
|
|
|
manager = Manager(app)
|
|
|
|
manager.add_command("db", MigrateCommand)
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
2017-07-30 17:35:16 +00:00
|
|
|
# Patch sys.argv to default to 'db'
|
|
|
|
sys.argv.insert(1, 'db')
|
2017-05-27 20:19:38 +00:00
|
|
|
|
2017-07-30 17:35:16 +00:00
|
|
|
manager.run()
|