Webhookのメッセージをカスタマイズできるように

This commit is contained in:
CyberRex
2026-05-27 10:59:58 +09:00
parent 2a4050d442
commit 38acbd35bb
14 changed files with 994 additions and 49 deletions

View File

@@ -99,6 +99,23 @@ CREATE TRIGGER notification_methods_set_updated_at
BEFORE UPDATE ON notification_methods
FOR EACH ROW EXECUTE FUNCTION set_updated_at();
CREATE TABLE IF NOT EXISTS user_notification_settings (
user_id uuid PRIMARY KEY REFERENCES users(user_id) ON DELETE CASCADE,
webhook_message_template text,
timezone text NOT NULL DEFAULT 'Asia/Tokyo',
created_at timestamptz NOT NULL DEFAULT now(),
updated_at timestamptz NOT NULL DEFAULT now()
);
ALTER TABLE user_notification_settings
ADD COLUMN IF NOT EXISTS webhook_message_template text,
ADD COLUMN IF NOT EXISTS timezone text NOT NULL DEFAULT 'Asia/Tokyo';
DROP TRIGGER IF EXISTS user_notification_settings_set_updated_at ON user_notification_settings;
CREATE TRIGGER user_notification_settings_set_updated_at
BEFORE UPDATE ON user_notification_settings
FOR EACH ROW EXECUTE FUNCTION set_updated_at();
CREATE TABLE IF NOT EXISTS site_alert_conditions (
site_alert_condition_id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
site_id uuid NOT NULL REFERENCES sites(site_id) ON DELETE CASCADE,