D84 · v1's rate-change audit and contract columns are kept as legacy_ columns on rentals and contracts, not as a table
Proposed · 2026-10-30 · zuki accepted the recommendation on #302 ("I accept your recommendations"); it binds when this page's pull request is merged
Decision: The rentals step carries the v1 columns it used to leave unread, without adding a table:
rentals.legacy_data jsonbholds, for each chain row that begins at a v1 fee change (R-RNT-41), that audit row'soleh,detail,plat_beforeandplat_after.contracts.legacy_updated_at timestamptzholds v1'scontracts.updated_at. v2's ownupdated_atis set by v2 and is not overwritten.- Every column that carries v1-only data is named
legacy_…. It is written by the migration and read by nobody in v2; a later migration may drop it when zuki says so. contracts.namaandv_rental_fee_audit.namaare not carried. Both are the driver's name, which v2 holds indrivers, and neither is published (D15). zuki signs them as ignored inmigration.accepted_differences(R-MIG-06) when he signs the report.- A change the chain does not carry is ignored on purpose and counted, not stored: the plate-only changes (253 of the 877 rows on the copy of 2026-10-29), several changes on one day merged to the day's last rate (R-RNT-59), the changes dated before the handover, and the 33 rows from
activity_log(R-RNT-43). The reconcile prints each count, and they add up to the rows ofv_rental_fee_audit.
Why:
- zuki, 2026-10-30, on #302: the audit columns "are kinda necessary", the audit log starts anew, so the data belongs on
rentals"without adding new table"; the contract'supdated_atmatters because v1 edits the current contract in place; "claim it all exceptcontracts.nama, and then if the current v2 don't really need them add suffixlegacy_"; "drop both nama columns, ignore the dropped changes". - D18 asks for zero unexplained rows. Columns on
rentalscan hold only the changes the chain carries, so the others are counted as ignored on purpose, as R-RNT-43 already does foractivity_log. inspections.legacy_data(20261006000700_operations.sql) is the same pattern: v1's original, read-only, in one jsonb column, so a later migration drops one column and not six.- D75: v1 is still developing, and the reconcile lists what no step reads (R-MIG-10) until a step claims it or zuki signs it. This decision claims six of the eight columns and signs two.
Consequences:
- The rules (DOC): R-RNT-43 stops saying the audit is not carried; it says v2's audit log starts at cutover and v1's rate-change audit is kept as
legacy_data. New R-RNT IDs follow R-RNT-67 for the two columns, the counted drops and the two signednamacolumns. - The schema and the step (BE):
rentals.legacy_dataandcontracts.legacy_updated_at, edited in place (D11); the step readsv_rental_fee_auditandcontracts.updated_at; the checks stop listing the claimed columns as unclaimed and print a count for the dropped changes; app roles cannot write alegacy_column. Tests first (D27). - BE-DP-36's expects change for
v1 unclaimed(7 lines become 2, the twonamacolumns, until zuki signs them). - v2's audit log still starts at cutover (build/cutover.md, step 2).
legacy_datais v1 data, not an audit entry. - Unchanged: the chain's rules (R-RNT-41, R-RNT-42, R-RNT-59),
migration.contract_terms(D11), and theactivity_logrows ignored on purpose.
- Is an amended contract a new row in v2? v1 edits the current contract in place, which zuki calls wrong. That is a rule for the contracts module, not this decision; it goes to DOC as a question the next time the contracts page is touched.