Story: Hotfix: Revert PR #1788 (IAM model drift) — broken DB schema

Table of Contents

This page documents a story in Sprint 24. It captures the goal, current status, acceptance criteria, and the tasks that compose it.

Goal

Restore main to a good state. PR #1788 (Fix iam entity model drift, merge commit 7645312a2, tip commit b8f5a3d18) broke the database schema. Revert the merge cleanly so downstream work on main is unblocked again.

Status

Field Value
State DONE
Parent sprint Sprint 24
Now Nothing.
Waiting on Nothing.
Next Nothing.
Last touched 2026-07-31

Acceptance

  • git revert -m 1 7645312a2 applied cleanly (no manual conflict resolution).
  • Local build/DB schema recreation succeeds on the reverted tree.
  • PR merged to main; main is green again.
  • jolly_knuth's underlying task/PR is flagged so the drift fix can be redone correctly later.

Tasks

Task State Start End Description
Scaffold story: Hotfix: Revert PR #1788 (IAM model drift) — broken DB schema DONE 2026-07-31 2026-07-31 Story scaffolding rides this task: documents, sprint wiring, and the scaffold PR. Close it before merging that PR.
Implement Hotfix: Revert PR #1788 (IAM model drift) — broken DB schema DONE 2026-07-31 2026-07-31 Initial task for: Hotfix: Revert PR #1788 (IAM model drift) — broken DB schema

Decisions

  • Reviewers flagged two items to preserve when the IAM model-drift fix is redone: the clock_timestamp() -> current_timestamp fix in the account_type/tenant_status/tenant_type insert triggers (avoids same-transaction multi-write collisions), and the security definer set search_path = public, pg_temp hardening on those same trigger functions (matches the pattern used elsewhere, e.g. refdata_book_statuses_create.sql).

Out of scope

  • Redoing the IAM model-drift fix correctly — tracked separately; jolly_knuth's original task should be reopened for this.

Emacs 29.3 (Org mode 9.6.15)