refactor(db): replace legacy fixture seed

This commit is contained in:
2026-03-10 18:50:50 +04:00
parent be4d388e2f
commit 54895c0bd2
3 changed files with 328 additions and 196 deletions

View File

@@ -0,0 +1,30 @@
# Development Reset
## Warning
This workflow is destructive for development data. Do not use it against any database you care about.
## Fixture refresh
`bun run db:seed` replaces the committed fixture household with a fresh multi-household-compatible dataset.
Use it when:
- you want current demo data without wiping the entire database
- you only need the seeded fixture household reset
## Full dev reset
Use a disposable local or dev database only.
Recommended flow:
1. point `DATABASE_URL` at a disposable database
2. recreate the database or reset the schema using your database host tooling
3. run `bun run db:migrate`
4. run `bun run db:seed`
## Notes
- The committed seed reflects the current product model: multi-household setup, GEL settlement, USD-denominated rent with locked FX, topic bindings, utility categories, and payment confirmations.
- If you need historical or household-specific fixtures, create them as separate scripts instead of editing old migrations or mutating the default seed ad hoc.

View File

@@ -61,6 +61,7 @@ bun run review:coderabbit
- Drizzle config is in `packages/db/drizzle.config.ts`.
- Typed environment validation lives in `packages/config/src/env.ts`.
- Copy `.env.example` to `.env` before running app/database commands.
- `bun run db:seed` refreshes the committed fixture household and is destructive for previously seeded fixture rows.
- Local bot feature flags come from env presence:
- finance commands require `DATABASE_URL` plus household setup in Telegram via `/setup`
- purchase ingestion requires `DATABASE_URL` plus a bound purchase topic via `/bind_purchase_topic`
@@ -69,6 +70,7 @@ bun run review:coderabbit
and optionally use a dedicated reminders topic via `/bind_reminders_topic`
- mini app CORS can be constrained with `MINI_APP_ALLOWED_ORIGINS`
- Migration workflow is documented in `docs/runbooks/migrations.md`.
- Destructive dev reset guidance is documented in `docs/runbooks/dev-reset.md`.
- First deploy flow is documented in `docs/runbooks/first-deploy.md`.
## CI/CD