Files
threadcount-community/prisma/migrations/20260907130000_audit_event/migration.sql
T
ThreadCount c89010a4f1 ThreadCount Community edition
Uniform stock management for healthcare linen rooms: the coordinator app, the phone counter and the staff app, for your own server. Built from f976bd5 on 2026-09-15. Licensed under the Functional Source License (FSL-1.1-ALv2).
2026-09-15 23:18:05 +10:00

17 lines
642 B
SQL

-- CreateTable
CREATE TABLE "AuditEvent" (
"id" TEXT NOT NULL,
"facilityId" TEXT NOT NULL,
"at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"userId" TEXT NOT NULL,
"userName" TEXT NOT NULL,
"op" TEXT NOT NULL,
"target" TEXT NOT NULL DEFAULT '',
"ip" TEXT NOT NULL DEFAULT '',
CONSTRAINT "AuditEvent_pkey" PRIMARY KEY ("id")
);
-- CreateIndex
CREATE INDEX "AuditEvent_facilityId_at_idx" ON "AuditEvent"("facilityId", "at");
-- AddForeignKey
ALTER TABLE "AuditEvent" ADD CONSTRAINT "AuditEvent_facilityId_fkey" FOREIGN KEY ("facilityId") REFERENCES "Facility"("id") ON DELETE CASCADE ON UPDATE CASCADE;