chore: initial import

This commit is contained in:
phamnazage-jpg
2026-05-12 17:47:32 +08:00
commit fc54ba84b2
104 changed files with 11575 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
-- 通知日志表
CREATE TABLE IF NOT EXISTS ai_ops_notification_logs (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
event_id UUID NOT NULL REFERENCES ai_ops_alerts(id) ON DELETE CASCADE,
channel_id UUID NOT NULL REFERENCES ai_ops_channels(id) ON DELETE CASCADE,
channel_type VARCHAR(32) NOT NULL,
status VARCHAR(16) NOT NULL DEFAULT 'pending'
CHECK (status IN ('pending', 'sent', 'failed', 'retrying')),
retry_count INT NOT NULL DEFAULT 0,
error_message TEXT NULL,
sent_at TIMESTAMPTZ NULL,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);
CREATE INDEX IF NOT EXISTS idx_notification_logs_event ON ai_ops_notification_logs(event_id);
CREATE INDEX IF NOT EXISTS idx_notification_logs_status ON ai_ops_notification_logs(status);
CREATE INDEX IF NOT EXISTS idx_notification_logs_created ON ai_ops_notification_logs(created_at DESC);