add: 本地开发 compose 编排、构建脚本与数据库初始化

This commit is contained in:
zetaloop
2026-04-01 03:45:11 +08:00
parent e7970ac25f
commit 507d8c6fd9
7 changed files with 501 additions and 1 deletions
+36
View File
@@ -0,0 +1,36 @@
#!/usr/bin/env bash
set -e
SQL_DIR="/docker-entrypoint-initdb.d/sql"
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" -f "$SQL_DIR/common/update_updated_at_column.sql"
ordered=(
users/users.sql
users/user_follows.sql
users/user_preferences.sql
users/user_verifications.sql
game/games.sql
player/players.sql
player/player_services.sql
shop/shop.sql
shop/shop_players.sql
shop/shop_invitations.sql
order/00-orders.sql
order/order_state_log.sql
wallet/00-wallets.sql
wallet/wallet_transactions.sql
community/posts.sql
community/comments.sql
community/post_likes.sql
community/comment_likes.sql
dispute/disputes.sql
dispute/dispute_timeline.sql
review/reviews.sql
search/favorites.sql
)
for f in "${ordered[@]}"; do
[ -f "$SQL_DIR/$f" ] || continue
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" -f "$SQL_DIR/$f"
done