docs: 整理 runtime 系列文档,修正 API 端点名称

This commit is contained in:
qzl
2026-03-02 10:55:46 +08:00
parent c3192a2431
commit 2ac56e5084
9 changed files with 350 additions and 172 deletions
+46
View File
@@ -0,0 +1,46 @@
#!/bin/bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "$0")/../.." && pwd)"
ENV_FILE="$ROOT_DIR/.env"
usage() {
echo "Usage: $0 {migrate|init-data|bootstrap}"
echo ""
echo "Commands:"
echo " migrate Run database migrations only"
echo " init-data Initialize seed data only"
echo " bootstrap Run migrations + init-data"
echo ""
echo "Note: Requires Supabase services running (docker compose up -d)"
exit 1
}
if [ ! -f "$ENV_FILE" ]; then
echo "Error: env file not found at $ENV_FILE" >&2
exit 1
fi
set -a
. "$ENV_FILE"
set +a
cd "$ROOT_DIR"
case "${1:-}" in
migrate)
echo "=== Running Migrations ==="
PYTHONPATH=backend/src uv run python -m core.runtime.cli migrate
;;
init-data)
echo "=== Running Init Data ==="
PYTHONPATH=backend/src uv run python -m core.runtime.cli init-data
;;
bootstrap)
echo "=== Running Bootstrap ==="
PYTHONPATH=backend/src uv run python -m core.runtime.cli bootstrap
;;
*)
usage
;;
esac