Add thesis status column for two-phase commit lifecycle tracking

This commit is contained in:
Pontoporeia
2026-06-11 12:09:24 +02:00
parent 11a6f6a9f2
commit f4a3e26901
5 changed files with 47 additions and 7 deletions

View File

@@ -0,0 +1,14 @@
-- 039: Add a status column to theses to track submission lifecycle
--
-- Lifecycle:
-- draft — thesis row created, file operations not yet completed (or failed)
-- active — all file operations succeeded, submission is complete
--
-- Separate from is_published (visibility). The admin can filter drafts
-- to find orphaned/broken submissions and the cleanup-drafts job targets
-- status='draft' rows older than a threshold.
ALTER TABLE theses ADD COLUMN status TEXT NOT NULL DEFAULT 'active';
-- Existing theses already have files → they are active.
-- New theses start as draft and are promoted to active after file ops succeed.