Skip to content

BE-DP-33 · The v1 tables and columns no step claims

ID BE-DP-33 · Level L0 · Pack Pack R4 · The migration machinery · Run order after the pull request for #324 is merged; then each night, as part of the reconcile · Issue #324

v1 is still developing (D75), so a table or a column can appear in it on any night. The reconcile's check v1 unclaimed lists, every night (R-MIG-10):

  • every table of the night's snapshot that no step reads, with its row count;
  • every column of a table some step reads that no step reads.

A step claims what it reads in migration.claims, beside its code. A listed line is claimed by a step, or signed by you as ignored in migration.accepted_differences with its reason (R-MIG-06). It stops nothing: the night still finishes.

This step runs the check once on the copy, so you see what it lists today. Lines name tables and columns, never a person, so they're safe to post (D15).

  • The pull request for #324 is merged, and you are on main after git pull, pnpm supabase db reset and BE-DP-07.
  • docker ps --filter name=v1copy lists the copy as Up.
Terminal window
docker exec -i supabase_db_opleet psql -qX -U postgres -d postgres -v ON_ERROR_STOP=1 <<'SQL'
select migration.begin_run('BE-DP-33, local, on the v1 copy') as run;
select migration.snapshot() as tables_copied;
select split_part(row_key, ' ', 1) as kind, count(*) as lines from migration.reconcile()
where check_name = 'v1 unclaimed' group by 1 order by 1;
select row_key, detail from migration.reconcile() where check_name = 'v1 unclaimed' order by 1;
select migration.finish_run('succeeded');
SQL
  • tables_copied 35 or so.
  • Tables no step reads yet: the ones whose steps aren't merged. Today that is the drivers step's (leads, antrian, deleted_leads), the rentals, operations and money steps' (for example contracts, handovers, maintenance, stock_opname_*, debts), but not v1's own backups: a table whose name contains backup is signed by that pattern and counted on one line, tables named backup (zuki, #591).
  • Columns: the columns of a read table that no step reads, such as app_settings.key and created_at.
  • Each later step's pull request claims its tables, so the list shrinks as the steps merge. A table v1 adds that no step reads stays until a step claims it or you sign it.

Post the two tables on #324. For each line, say one of:

  • "a step will read it": name the step, or leave it to the Backend Engineer;
  • "ignore": with a reason, and the Backend Engineer writes your signature into the migration for your review (R-MIG-06).
  • tables_copied 0: v1_live isn't linked. Run BE-DP-07, then the block again.
  • Anything else: post the ERROR line on #324.

Nothing to undo beyond the night's run: pnpm supabase db reset removes the snapshot.

Log each run as a comment on #324: date · who · result, with the two tables.