-- Inertia in five levels (2026-10-30, ADR 0007). Additive: nothing is lost. -- -- The four words of before become levels: low → 2, standard → 3, high → 4, -- max → 5 (level 1 is new, below them). Each word is first kept as it was, in a -- column of its own, then its level is written in its place. The adoptions are -- left as they are: their `params` hold the M and G each was judged by. The -- server still reads the four words (a row written by an older image). ALTER TABLE units ADD COLUMN inertia_legacy TEXT; -- the word before 2026-10-30, as it was UPDATE units SET inertia_legacy = inertia WHERE inertia IN ('low', 'standard', 'high', 'max'); UPDATE units SET inertia = CASE inertia WHEN 'low' THEN '2' WHEN 'standard' THEN '3' WHEN 'high' THEN '4' WHEN 'max' THEN '5' END WHERE inertia IN ('low', 'standard', 'high', 'max'); ALTER TABLE proposals ADD COLUMN inertia_target_legacy TEXT; -- the word before 2026-10-30, as it was UPDATE proposals SET inertia_target_legacy = inertia_target WHERE inertia_target IN ('low', 'standard', 'high', 'max'); UPDATE proposals SET inertia_target = CASE inertia_target WHEN 'low' THEN '2' WHEN 'standard' THEN '3' WHEN 'high' THEN '4' WHEN 'max' THEN '5' END WHERE inertia_target IN ('low', 'standard', 'high', 'max'); -- Every change of the inertia of an article from now on, by a vote or by an -- amendment of the seed: what the article says of its own inertia. CREATE TABLE inertia_changes ( id INTEGER PRIMARY KEY AUTOINCREMENT, unit_id TEXT NOT NULL REFERENCES units(id), doc_id TEXT NOT NULL REFERENCES documents(id), from_level TEXT NOT NULL, to_level TEXT NOT NULL, cause TEXT NOT NULL, -- vote | amendment proposal_id TEXT, -- the change of inertia voted amendment_id TEXT, -- the amendment applied at TEXT NOT NULL ); CREATE INDEX inertia_changes_unit ON inertia_changes(unit_id); -- Inertia amendments (src/inertia_amend.rs): a starting level of the seed raised -- in an existing base, decided once per document and only on an article whose -- inertia no vote ever changed. Each decision is kept here: applied, refused -- (and why), or already present. CREATE TABLE inertia_amendments ( amendment_id TEXT NOT NULL, doc_id TEXT NOT NULL REFERENCES documents(id), unit_code TEXT NOT NULL, from_level TEXT, -- the level found to_level TEXT NOT NULL, outcome TEXT NOT NULL, -- applied | refused | present reason TEXT, -- why it was refused at TEXT NOT NULL, PRIMARY KEY (amendment_id, doc_id) );