.PHONY: up down build logs sync sync-index sync-sentiment shell psql init-db

up:            ## 启动
	docker compose up -d --build
down:          ## 停止
	docker compose down
build:
	docker compose build
logs:
	docker compose logs -f backend
init-db:
	docker compose exec backend python -m app.etl init-db

# 同步（START 可覆盖：make sync START=20200101）
START ?= 20150101
sync:
	docker compose exec backend python -m app.etl sync-all --start $(START)
sync-index:
	docker compose exec backend python -m app.etl sync-index --start $(START)
sync-sentiment:
	docker compose exec backend python -m app.etl sync-sentiment --start $(START)

shell:
	docker compose exec backend bash
psql:
	docker compose exec db psql -U asevent -d asevent
