fix(db): reset-db categorises the Car Wash tables and role_jobs — the drift guard refused every reset on a booth carrying them
Build & push images / images (push) Successful in 2m47s
Build & push images / images (push) Successful in 2m47s
Claude-Session: https://claude.ai/code/session_01FWncR69HgGPuei1dLrW3cU
This commit is contained in:
@@ -51,6 +51,10 @@ const CATEGORIES = {
|
|||||||
"subscription_credentials",
|
"subscription_credentials",
|
||||||
"subscriptions",
|
"subscriptions",
|
||||||
"blocklist",
|
"blocklist",
|
||||||
|
// Car Wash (venue module): orders are money history (settled against ledger events);
|
||||||
|
// the review outbox is a delivery queue of crops + choices — both go with the ledger.
|
||||||
|
"carwash_review_outbox",
|
||||||
|
"carwash_orders",
|
||||||
],
|
],
|
||||||
config: [
|
config: [
|
||||||
"site_config",
|
"site_config",
|
||||||
@@ -65,8 +69,15 @@ const CATEGORIES = {
|
|||||||
// whose user is gone grants nothing.
|
// whose user is gone grants nothing.
|
||||||
"validation_program_users",
|
"validation_program_users",
|
||||||
"validation_programs",
|
"validation_programs",
|
||||||
|
// Car Wash master data: prices reference categories + services (child first); the
|
||||||
|
// module's site-level config (pay-at, vision threshold) is config like site_config.
|
||||||
|
"carwash_prices",
|
||||||
|
"carwash_categories",
|
||||||
|
"carwash_services",
|
||||||
|
"carwash_config",
|
||||||
],
|
],
|
||||||
users: ["sessions", "role_permissions", "users", "roles"],
|
// role_jobs = which jobs a role follows (child of roles).
|
||||||
|
users: ["sessions", "role_permissions", "role_jobs", "users", "roles"],
|
||||||
diagnostics: ["app_logs"],
|
diagnostics: ["app_logs"],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -70,9 +70,9 @@ RESET_ALLOWED=1 DATABASE_URL=/path node packages/db/scripts/reset-db.mjs --all
|
|||||||
|
|
||||||
| Flag | Wipes | Keeps |
|
| Flag | Wipes | Keeps |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| `--financial` | `ledger_events` (entry/exit/payment/void/shift/cash/anomaly), `device_events`, `snapshots`, subscription **instances** + credentials/plates, `blocklist` | users, devices, config, tariffs, subscription **plans** |
|
| `--financial` | `ledger_events` (entry/exit/payment/void/shift/cash/anomaly), `device_events`, `snapshots`, subscription **instances** + credentials/plates, `blocklist`, `carwash_orders`, `carwash_review_outbox` | users, devices, config, tariffs, subscription **plans**, Car Wash master data |
|
||||||
| `--config` | `site_config`, `devices`, `setup_state` (→ re-runs first-run setup), tariffs + versions + **drafts**, subscription plans | everything else |
|
| `--config` | `site_config`, `devices`, `setup_state` (→ re-runs first-run setup), tariffs + versions + **drafts**, subscription plans, validation programs, `carwash_prices/categories/services/config` | everything else |
|
||||||
| `--users` | `users`, `roles`, `role_permissions`, auth `sessions` | everything else |
|
| `--users` | `users`, `roles`, `role_permissions`, `role_jobs`, auth `sessions` | everything else |
|
||||||
| `--diagnostics` | `app_logs` (the unsigned [[app-logs]] store behind `/setup/logs`) | everything else |
|
| `--diagnostics` | `app_logs` (the unsigned [[app-logs]] store behind `/setup/logs`) | everything else |
|
||||||
| `--all` | every table (blank slate) | — |
|
| `--all` | every table (blank slate) | — |
|
||||||
|
|
||||||
|
|||||||
@@ -415,6 +415,14 @@ docker exec -it \
|
|||||||
> it) **and** you type the DB filename to confirm (`parking.sqlite`; `--yes` skips that for scripted
|
> it) **and** you type the DB filename to confirm (`parking.sqlite`; `--yes` skips that for scripted
|
||||||
> setup only). It is a **training/demo** tool — never run on a production booth's data.
|
> setup only). It is a **training/demo** tool — never run on a production booth's data.
|
||||||
|
|
||||||
|
> **Drift caught 2026-09-07:** the Car Wash module (six `carwash_*` tables) and `role_jobs` had
|
||||||
|
> landed without a category, so the guard refused every reset on a booth carrying them. Categorised
|
||||||
|
> now — orders + the review outbox under `--financial`, prices/categories/services/config under
|
||||||
|
> `--config`, `role_jobs` under `--users` — and verified `--all` on a freshly migrated DB. The script
|
||||||
|
> ships **inside the server image**, so a booth runs the fixed version only from the next deployed
|
||||||
|
> tag; until then `docker cp` the file from the repo into the container at
|
||||||
|
> `/app/node_modules/@parking/db/scripts/reset-db.mjs` and run the same command.
|
||||||
|
|
||||||
After `--users`/`--all` (users cleared), re-seed the first admin exactly as in §7b
|
After `--users`/`--all` (users cleared), re-seed the first admin exactly as in §7b
|
||||||
(`docker exec … node scripts/seed-admin.mjs`) so someone can log back in. Since 2026-07-06 the seed
|
(`docker exec … node scripts/seed-admin.mjs`) so someone can log back in. Since 2026-07-06 the seed
|
||||||
script **self-heals the built-in `admin` role row** that this reset also wipes — before that fix the
|
script **self-heals the built-in `admin` role row** that this reset also wipes — before that fix the
|
||||||
|
|||||||
@@ -3144,6 +3144,15 @@ run; the Quadro FX 3800 is unusable (cc 1.3), the HD P530 irrelevant, the Xeon E
|
|||||||
compose seam drops the GPU reservation; cloud GPU rejected (crops stay on premises). Linked from
|
compose seam drops the GPU reservation; cloud GPU rejected (crops stay on premises). Linked from
|
||||||
[[opencv-anpr-service]], [[vision-review-outbox]], index. User: "No build just yet."
|
[[opencv-anpr-service]], [[vision-review-outbox]], index. User: "No build just yet."
|
||||||
|
|
||||||
|
## [2026-09-07] fix | reset-db drift — Car Wash tables and role_jobs were uncategorised
|
||||||
|
User asked for "the command to reset everything in the booth pc". The documented command
|
||||||
|
([[appliance-provisioning]] §7d, `docker exec … reset-db.mjs --all`) would have been refused on
|
||||||
|
park-2: the drift guard found `carwash_*` (six tables) and `role_jobs` outside every category.
|
||||||
|
Categorised (orders + review outbox → financial; prices/categories/services/config → config;
|
||||||
|
role_jobs → users), `--all` verified on a freshly migrated DB. The script ships in the server
|
||||||
|
image — fixed on the booth from the next deployed tag, or by `docker cp` until then. Table
|
||||||
|
rows updated on [[local-dev-workflow]].
|
||||||
|
|
||||||
## [2026-09-07] decision | Desktop v0.2.0 — a minor bump, not a patch
|
## [2026-09-07] decision | Desktop v0.2.0 — a minor bump, not a patch
|
||||||
User: "Do you think we are ready for version 0.2.0? The actual version is 0.1.7." Yes: v0.1.x
|
User: "Do you think we are ready for version 0.2.0? The actual version is 0.1.7." Yes: v0.1.x
|
||||||
were all shell fixes; the bundled SPA now carries the module registry, Car Wash + per-till
|
were all shell fixes; the bundled SPA now carries the module registry, Car Wash + per-till
|
||||||
|
|||||||
Reference in New Issue
Block a user