app.project_measurement_corrections
TableRow level security on
Append-only ledger of every correction, withdrawal and restore of a recorded figure, with the figure before and after and the reason. Who made the change and when are created_by and created_at. Written only by the measurement guard.
Primary key: id
| Column | Type | Nullable | Description |
|---|---|---|---|
| id | uuid | No | Primary key, UUID v7. |
| org_id | uuid | No | Owning org, derived from app.project_measurements on insert; never accepted from the caller and never changed.References app.organizations.id |
| project_measurement_id | uuid | No | Figure that changed.References app.project_measurements.id |
| correction_kind | app.measurement_correction_kind | No | Corrected, Withdrawn or Restored. |
| previous_value | numeric | Yes | Value before the change; NULL when it was Unmeasured. |
| previous_unit_code | text | Yes | Unit before the change.References private.measurement_units.unit_code |
| previous_measured_on | date | No | Day before the change. |
| value | numeric | Yes | Value after the change; NULL when Unmeasured. |
| unit_code | text | Yes | Unit after the change.References private.measurement_units.unit_code |
| measured_on | date | No | Day after the change. |
| reason | text | Yes | Why the figure changed; required for a correction. |
| created_at | timestamp with time zone | No | When the row was inserted. Set by the database. |
| created_by | uuid | Yes | Person who inserted the row, or null for a platform process. Set by the database.References app.people.id |
| updated_at | timestamp with time zone | No | When the row last changed. Set by the database. |
| updated_by | uuid | Yes | Person who last changed the row, or null for a platform process. Set by the database.References app.people.id |
| deleted_at | timestamp with time zone | Yes | Soft delete time. A row with deleted_at set is ignored by every access helper. |