Files
decision/crates/ld-server/migrations/0009_seed_proposals.sql
T

37 lines
2.2 KiB
SQL

-- Propositions seed (2026-11-02, ADR 0011). Additive only: nothing is dropped,
-- nothing an older image needs is rewritten.
--
-- Yvv, 2026-11-02: « pour le démarrage, conserve un statut particulier pour les
-- 3 premiers modules. Mais ils ne sont pas en vigueur. Appelle les "Proposition
-- seed" (intégré par un ou deux clients pour amorcer le mouvement de vote). »
--
-- A seed proposal is an open proposal of the seed put forward to start the vote
-- (I1, E1, E2 of the certification act). It is not in force: it enters like any
-- proposal, by its threshold. The mark stays on the row once written; what the
-- API calls `seedProposal` is read from it while the version is open and was
-- never voted into force (src/docs.rs). An older image ignores the column and
-- reads the version as an open proposal of the seed.
ALTER TABLE proposals ADD COLUMN seed_featured INTEGER NOT NULL DEFAULT 0;
-- The starting texts in force made seed proposals in an existing base
-- (src/seed_proposal_amend.rs): decided once per document and article, and
-- only where nobody has touched the text. With the status, the article's level
-- of inertia goes low (Yvv, 2026-11-02: « l'amorcer avec une inertie basse »),
-- only where nobody has touched it either. Each decision is kept here, for the
-- status and for the level: applied, refused (and why), or present (the base
-- was born with the seed proposal, at the low level).
CREATE TABLE seed_proposal_amendments (
amendment_id TEXT NOT NULL,
doc_id TEXT NOT NULL REFERENCES documents(id),
unit_code TEXT NOT NULL,
proposal_id TEXT, -- the version examined: in force, or the seed proposal found
outcome TEXT NOT NULL, -- applied | refused | present (the status)
reason TEXT, -- why it was refused
from_level TEXT, -- the level found
to_level TEXT NOT NULL, -- the level seed proposals start at
level_outcome TEXT NOT NULL, -- applied | refused | present (the level)
level_reason TEXT, -- why it was refused
at TEXT NOT NULL,
PRIMARY KEY (amendment_id, doc_id)
);