project-bifrost-platform/migrations/0008_roadmap_planned.sql
Jonathan Hvid 59842432bd feat(roadmap): add planned status
Adds a fifth roadmap status, `planned`, for items that are committed and
scheduled but not yet started — sitting between `in_beta` and `exploring`
in the progression. Rendered with the design system's indigo pigment
(#5a6d83) on the route, carousel, legend, and admin pill.

Migration 0008 widens the status CHECK constraint via a table rebuild
(SQLite can't alter it in place), preserving rows and attributions.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-10 11:30:06 +02:00

39 lines
1.6 KiB
SQL

-- Roadmap status enum gains a fifth value `planned` for items that are
-- committed and scheduled but not yet started — sitting between `in_beta`
-- and `exploring` in the progression.
--
-- SQLite can't widen a CHECK constraint in place, so this is a full table
-- rebuild (same approach as 0006). roadmap_attributions has an ON DELETE
-- CASCADE FK to roadmap_items(id), so foreign keys are toggled off around
-- the rebuild to preserve attribution rows across the DROP/RENAME. The
-- metadata_text column added in 0007 is carried through.
PRAGMA foreign_keys = OFF;
CREATE TABLE roadmap_items_new (
id INTEGER PRIMARY KEY AUTOINCREMENT,
title TEXT NOT NULL,
description TEXT NOT NULL DEFAULT '',
status TEXT NOT NULL DEFAULT 'exploring'
CHECK(status IN ('shipping','in_beta','planned','exploring','considering')),
target TEXT,
display_order INTEGER NOT NULL DEFAULT 0,
shipped_at TEXT,
metadata_text TEXT,
created_at TEXT NOT NULL DEFAULT (datetime('now')),
updated_at TEXT NOT NULL DEFAULT (datetime('now'))
);
INSERT INTO roadmap_items_new
(id, title, description, status, target, display_order, shipped_at, metadata_text, created_at, updated_at)
SELECT
id, title, description, status, target, display_order, shipped_at, metadata_text, created_at, updated_at
FROM roadmap_items;
DROP TABLE roadmap_items;
ALTER TABLE roadmap_items_new RENAME TO roadmap_items;
CREATE INDEX idx_roadmap_status ON roadmap_items(status, display_order);
CREATE INDEX idx_roadmap_shipped ON roadmap_items(shipped_at);
PRAGMA foreign_keys = ON;