Simplify migrations and redesign utility scripts.

This commit is contained in:
Michael House 2022-06-29 00:18:14 -05:00 committed by GitHub
parent 19cc4d3d6e
commit 17217d56c2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 146 additions and 67 deletions

21
util/migrate.py Executable file
View file

@ -0,0 +1,21 @@
#!/usr/bin/env python3
import sys
from common import _operation
def run_migrate(args):
command = 'upgrade'
if len(args) > 1:
command = args[1]
result = _operation(command,[
"cd service",
"export FLASK_APP=files/cli:app",
f"python3 -m flask db {command}",
])
sys.exit(result.returncode)
if __name__=='__main__':
run_migrate(sys.argv)