CREATE TABLE IF NOT EXISTS strategy_runtime_config (
    config_key TEXT PRIMARY KEY,
    config_json TEXT NOT NULL DEFAULT '{}',
    description TEXT DEFAULT '',
    source TEXT DEFAULT 'system',
    updated_by TEXT DEFAULT '',
    created_at TEXT NOT NULL,
    updated_at TEXT NOT NULL
);

CREATE TABLE IF NOT EXISTS system_config (
    config_key TEXT PRIMARY KEY,
    config_json TEXT NOT NULL DEFAULT '{}',
    description TEXT DEFAULT '',
    source TEXT DEFAULT 'system',
    is_secret INTEGER DEFAULT 0,
    updated_by TEXT DEFAULT '',
    created_at TEXT NOT NULL,
    updated_at TEXT NOT NULL
);

CREATE INDEX IF NOT EXISTS idx_strategy_runtime_config_updated ON strategy_runtime_config(updated_at DESC);
CREATE INDEX IF NOT EXISTS idx_system_config_updated ON system_config(updated_at DESC);
