-- Source configuration for selecting which items to fetch
CREATE TABLE IF NOT EXISTS source_config (
    id INTEGER PRIMARY KEY AUTOINCREMENT,
    source TEXT NOT NULL,           -- 'trello', 'todoist', 'gcal', 'gtasks'
    item_type TEXT NOT NULL,        -- 'board', 'project', 'calendar', 'tasklist'
    item_id TEXT NOT NULL,          -- ID from the source
    item_name TEXT NOT NULL,        -- Display name
    enabled INTEGER NOT NULL DEFAULT 1,
    updated_at TEXT NOT NULL DEFAULT (datetime('now', 'localtime')),
    UNIQUE(source, item_type, item_id)
);

CREATE INDEX IF NOT EXISTS idx_source_config_source ON source_config(source, enabled);
