一键导入
ppt-db-migrations
Apply / author SQLx migrations for the PPT databases — and document the missing-seed-recipe gap.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Apply / author SQLx migrations for the PPT databases — and document the missing-seed-recipe gap.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Implement one task end-to-end for the PPT project — pick the right per-stack specialist, code, verify per-stack, push a draft PR against `dev`.
Project-management & delivery analysis for the PPT research routine (Phase 1.6). Runs an always-on Scrum Master synthesis plus role-based deep analysis (rotating one role/day by default; all 8 on `full`; a specific role on `pm:<role>`). Reads sprint-status + repo activity + research backlog, spawns role subagents, and writes delivery artifacts under .research/management/. Use from routine Phase 1.6, or standalone for a delivery snapshot.
Post-merge code review with issue creation. Reviews merged PRs in a time window, spots better approaches / missed edge cases / security holes / perf issues / test gaps, and opens GitHub issues with concrete improvement proposals.
Deterministic goal/convergence checks for the PPT dispatcher — coverage referential integrity, coverage-progress monotonicity, and buffer bounds. Run in dispatcher Phase 6 and CI. Use when adding/auditing the dispatcher's goal-verification layer.
Open a PR in this project's style — title, body template, IG3 evidence, CI surface, draft handling.
Land a green, approved PR. Verify preconditions (CI green, approved, no unresolved threads, not draft), auto-resolve mechanical merge conflicts against the base branch (sqlx offline data, Cargo.lock, generated openapi/api-client, lockfiles), then `gh pr merge --squash --auto`. Stops and surfaces if real code conflicts or stale CI.
| name | ppt-db-migrations |
| description | Apply / author SQLx migrations for the PPT databases — and document the missing-seed-recipe gap. |
| when_to_use | The plan adds a migration, changes the schema, or needs seeded data to repro. |
| mode | both |
| capabilities | ["C2","C6"] |
| tags | ["backend","infra"] |
This repo is all-SQLx (Rust). There is no Drizzle / JS migration tool — the JS side consumes a generated client over HTTP, it doesn't talk to the DB directly. Two separate migration trees exist for two separate databases.
just db-prepare after migrating
(see ppt-rust-backend)just seed recipe — what that means for youpostgres reachable on localhost:5432 (bring up via
ppt-dev-stack)DATABASE_URL exported in env (commonly postgres://ppt:ppt@localhost:5432/ppt
— check docker-compose.dev.yml for the actual credentials)| DB | Migrations dir | Server | Notes |
|---|---|---|---|
| Main PPT DB | backend/crates/db/migrations/ | api-server, reality-server | Numbered NNNNN_<name>.sql |
| Deploy server DB | backend/servers/deploy-server/migrations/ | deploy-server | Independent — separate DB |
just db-migrate
# under the hood: cd backend/crates/db && sqlx migrate run
For the deploy-server DB, migrations apply automatically on
deploy-server start (or cd backend/servers/deploy-server && sqlx migrate run).just db-migration <name>
# creates backend/crates/db/migrations/<ts>_<name>.sql
# edit the file, then:
just db-migrate
just db-prepare
# cd backend && cargo sqlx prepare --workspace
Commit the regenerated backend/.sqlx/*.json.just seedjustfile has no seed, db-seed, or seed-db recipe
(verified by grep '^seed\|db-seed\|seed-db' justfile → empty).
The seed code exists as a Rust module at backend/crates/db/src/seed/
(data.rs, factories.rs, runner.rs, mod.rs) and is consumed
in-process by tests and one-off binaries.
Implications for the implementer:
just seed in PR bodies or test plans. It doesn't exist.seed module's factories
directly inside the test, or invoke runner from a small binary if the
plan demands a CLI-style seed.seed recipe exists, treat it as stale evidence
(per implementer prompt § Stale evidence aborts) — file an issue,
don't fabricate the recipe.ppt_seed only works if the host's seed_command is
configured at https://p.rlt.sk/accounts. On hosts without it, the
call errors cleanly.If you decide to add a seed recipe, the minimum kit is:
seed.sql (or seed-bin binary wrapping backend/crates/db/src/seed/runner.rs)seed recipe in justfile:
seed:
cd backend && cargo run --bin seed-bin
just db-prepare after, if the seed introduces new queries.That change is out of scope for any plan that doesn't explicitly call it out — file as a separate vector.
# 1. sqlx-cli available
cargo sqlx --version >/dev/null 2>&1 || sqlx --version >/dev/null 2>&1
# expected: zero exit (one form works)
# 2. both migration dirs exist
test -d backend/crates/db/migrations && \
test -d backend/servers/deploy-server/migrations && echo OK
# expected: OK
# 3. seed module present (for in-test seeding)
test -f backend/crates/db/src/seed/runner.rs && echo OK
# expected: OK
# 4. confirm `just seed` truly does not exist (regression guard)
just --list 2>/dev/null | grep -E '^\s+(seed|db-seed|seed-db)\b' | wc -l
# expected: 0
test -d backend/crates/db/migrations && test -d backend/servers/deploy-server/migrations && test -f backend/crates/db/src/seed/runner.rs
just db-migrate && just db-prepare
ppt-rust-backend — workspace contextppt-dev-stack — bring postgres up firstppt-bridge-mcp — ppt_seed / ppt_db_query
in cloud mode