Files
ridebus-admin/backend/migrations/007_alert_creation_idempotency.sql
Zakhar Timoshenko ddd67f438b feat: Implement alert creation service with FCM notifications
- 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.
2026-07-11 01:18:18 +03:00

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);