mirror of
https://github.com/BaaRai/ARTEX.git
synced 2026-11-25 09:20:53 +08:00
withdrawn_at was added only in db/schema.sql. db/db.go says new DDL goes in a numbered migration, so the change is now recorded in schema_migrations as 0012_lesson_withdrawn.sql (0011 is the last migration on main). The column and its ALTER ... IF NOT EXISTS stay in schema.sql, the idempotent base, as main does for report_state. The test builds a database without the column and without the 0012 row, holding an adopted lesson with two evidence rows. Open adds a nullable TIMESTAMPTZ with no default, keeps both rows live, and records 0012; a second Open changes nothing.
6 lines
341 B
SQL
6 lines
341 B
SQL
-- RSI lesson evidence keeps a retracted source on its row: withdrawn_at is set
|
|
-- instead of deleting it. Support and selection count only rows where it is
|
|
-- NULL, so existing evidence stays live. schema.sql carries the same column for
|
|
-- a fresh install.
|
|
ALTER TABLE rsi_lesson_evidence ADD COLUMN IF NOT EXISTS withdrawn_at TIMESTAMPTZ;
|