File size: 651 Bytes
f15b6d7
 
 
 
 
 
 
 
1e207a2
 
 
 
 
 
 
 
f15b6d7
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env bash
set -euo pipefail

APP_MODULE="run.py"
MIGRATION_MESSAGE="Auto Migration Sync"

export OAUTHLIB_INSECURE_TRANSPORT=1

echo "[Script] Checking Migrations Directory ..."
if [ ! -d "migrations" ]; then
    echo "[Script] Initializing Migrations ..."
    uv run flask --app "$APP_MODULE" db init
else
    echo "[Script] Migrations Directory Exists ..."
fi

echo "[Script] Ensuring Migrations Are Up To Date ..."
uv run flask --app "$APP_MODULE" db migrate -m "$MIGRATION_MESSAGE"

echo "[Script] Applying Migrations ..."
uv run flask --app "$APP_MODULE" db upgrade

echo "[Script] Starting Development Server ..."
uv run "$APP_MODULE"