Files
ITWorx-Pulse-Public/internal/database/migrations/0014_incident_notes.sql
T
ITWorx Pulse release export bd774932d5
Public source validation / validate (push) Failing after 3m8s
Publish ITWorx Pulse source
2026-09-03 02:09:19 +02:00

10 lines
421 B
SQL

CREATE TABLE incident_notes (
id uuid PRIMARY KEY,
incident_id uuid NOT NULL REFERENCES incidents(id) ON DELETE CASCADE,
author text NOT NULL CHECK (char_length(author) BETWEEN 1 AND 160),
body text NOT NULL CHECK (char_length(body) BETWEEN 1 AND 2000),
created_at timestamptz NOT NULL DEFAULT now()
);
CREATE INDEX incident_notes_history_idx ON incident_notes (incident_id, created_at ASC, id ASC);