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-05-21 15:47:16 +00:00
|
|
|
from nyaa import app, db
|
|
|
|
from flask_script import Manager
|
|
|
|
from flask_migrate import Migrate, MigrateCommand
|
|
|
|
|
|
|
|
migrate = Migrate(app, db)
|
|
|
|
|
|
|
|
manager = Manager(app)
|
|
|
|
manager.add_command("db", MigrateCommand)
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
2017-05-27 20:19:38 +00:00
|
|
|
# Patch sys.argv to default to 'db'
|
|
|
|
argv_contents = sys.argv[:]
|
|
|
|
|
|
|
|
sys.argv.clear()
|
|
|
|
sys.argv.append(argv_contents[0])
|
|
|
|
sys.argv.append('db')
|
|
|
|
sys.argv.extend(argv_contents[1:])
|
|
|
|
|
2017-05-21 15:47:16 +00:00
|
|
|
manager.run()
|