accounts/scripts/migrate-db.sh

13 lines
320 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env bash
set -euo pipefail
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/_common.sh"
echo ">>> 执行数据库迁移"
if [ ! -d sql/migrations ]; then
echo "⚠️ 未找到 sql/migrations跳过迁移"
exit 0
fi
go run ./cmd/migratectl/main.go migrate --dsn "${DB_URL}" --dir sql/migrations