- Add AlertCreationService to handle alert creation and notifications. - Implement idempotency key support to prevent duplicate alerts. - Create alert notification service for sending FCM messages. - Add tests for alert creation and notification services. - Document FCM notification flow and alert creation process.
11 lines
388 B
SQL
11 lines
388 B
SQL
CREATE TABLE IF NOT EXISTS alert_creation_requests (
|
|
idempotency_key VARCHAR(255) PRIMARY KEY,
|
|
request_hash CHAR(64) NOT NULL,
|
|
alert_id INTEGER REFERENCES alerts(id) ON DELETE SET NULL,
|
|
response_body JSONB,
|
|
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
|
);
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_alert_creation_requests_created_at
|
|
ON alert_creation_requests(created_at);
|