mirror of
https://github.com/Dvorinka/Bookra.git
synced 2026-06-04 12:33:00 +00:00
first commit
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
-- +goose Up
|
||||
CREATE TABLE IF NOT EXISTS notification_delivery_logs (
|
||||
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
||||
tenant_id uuid NOT NULL REFERENCES tenants(id) ON DELETE CASCADE,
|
||||
reminder_job_id uuid REFERENCES reminder_jobs(id) ON DELETE SET NULL,
|
||||
channel text NOT NULL,
|
||||
provider text NOT NULL,
|
||||
recipient text NOT NULL,
|
||||
delivery_status text NOT NULL,
|
||||
external_id text,
|
||||
error_message text,
|
||||
created_at timestamptz NOT NULL DEFAULT now()
|
||||
);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_notification_delivery_logs_tenant_time
|
||||
ON notification_delivery_logs (tenant_id, created_at DESC);
|
||||
|
||||
-- +goose Down
|
||||
DROP INDEX IF EXISTS idx_notification_delivery_logs_tenant_time;
|
||||
DROP TABLE IF EXISTS notification_delivery_logs;
|
||||
Reference in New Issue
Block a user