Simplify migrations and redesign utility scripts.
This commit is contained in:
parent
19cc4d3d6e
commit
17217d56c2
8 changed files with 146 additions and 67 deletions
21
util/migrate.py
Executable file
21
util/migrate.py
Executable 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)
|
Loading…
Add table
Add a link
Reference in a new issue