feat(FN-2383): persist task priority across core storage
- Add task-priority contract, normalization helpers, and exports in @fusion/core types/index - Store task priority in SQLite and migrate existing databases with default values - Update task store behavior and sorting tests to preserve and order by persisted priority - Add migration/regression coverage for archived tasks and refresh storage/task-management docs
This commit is contained in:
@@ -86,7 +86,7 @@ export function probeFts5(db: DatabaseSync): boolean {
|
||||
|
||||
// ── Schema Definition ────────────────────────────────────────────────
|
||||
|
||||
const SCHEMA_VERSION = 42;
|
||||
const SCHEMA_VERSION = 43;
|
||||
|
||||
function normalizeTaskComments(
|
||||
steeringComments: SteeringComment[] | undefined,
|
||||
@@ -152,6 +152,7 @@ CREATE TABLE IF NOT EXISTS tasks (
|
||||
id TEXT PRIMARY KEY,
|
||||
title TEXT,
|
||||
description TEXT NOT NULL,
|
||||
priority TEXT DEFAULT 'normal',
|
||||
"column" TEXT NOT NULL,
|
||||
status TEXT,
|
||||
size TEXT,
|
||||
@@ -1700,6 +1701,19 @@ export class Database {
|
||||
});
|
||||
}
|
||||
|
||||
// Task priority contract (FN-2383)
|
||||
// Adds priority column and normalizes legacy/missing values to 'normal'.
|
||||
if (version < 43) {
|
||||
this.applyMigration(43, () => {
|
||||
this.addColumnIfMissing("tasks", "priority", "TEXT DEFAULT 'normal'");
|
||||
this.db.exec(`
|
||||
UPDATE tasks
|
||||
SET priority = 'normal'
|
||||
WHERE priority IS NULL OR priority = '' OR priority NOT IN ('low', 'normal', 'high', 'urgent')
|
||||
`);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user