This commit is contained in:
toom1996
2026-09-17 22:51:00 +08:00
parent 766c691eb3
commit f7ae917603
33 changed files with 8181 additions and 3094 deletions

View File

@ -8,13 +8,13 @@ build:
run: build
./bin/server
# 结构迁移为手动 SQL(无自动运行器):db/migrations/001-007(ingest/review 链)
# 与 scripts/sql/002-008(i18n/账号链)内容互补,按文件名顺序用 mysql 客户端执行,例如:
# mysql db_dev < db/migrations/001_create_street_snap.sql
# mysql db_dev < db/migrations/002_ingest.sql
# ... 两套链都跑完才是完整 schema
# 表结构由 GORM AutoMigrate 在 server 启动时幂等创建,无需手动 SQL。
# 跨环境搬运全库数据(结构 + 数据)用 dbtool:
# go run ./cmd/dbtool dump -out db_dump.json
# go run ./cmd/dbtool import -in db_dump.json # 整机重建
# go run ./cmd/dbtool import -in db_dump.json -data-only # 仅导数据(结构已由 AutoMigrate 建好)
migrate:
@echo "Migrations are manual SQL. Apply db/migrations/001-007 then scripts/sql/002-008 via a mysql client."
@echo "Schema is auto-migrated by server on startup (GORM AutoMigrate). Use 'go run ./cmd/dbtool' to move data between environments."
# 跑单测
test: