Files
backend_v2/Makefile
toom1996 74ba700598 update
2026-09-07 00:01:48 +08:00

34 lines
921 B
Makefile
Raw Permalink 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.

.PHONY: build run migrate test tidy docker clean
# 编译 server
build:
go build -o bin/server ./cmd/server
# 构建并启动 API 服务(默认读取 configs/config.yml)
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
migrate:
@echo "Migrations are manual SQL. Apply db/migrations/001-007 then scripts/sql/002-008 via a mysql client."
# 跑单测
test:
go test ./...
# 整理依赖(需联网拉取测试依赖,离线环境慎用)
tidy:
go mod tidy
# 构建镜像
docker:
docker build -t fashionapi .
# 清理产物
clean:
rm -rf bin server server.exe