Skip to content

Commit bd25b1f

Browse files
authored
Merge branch 'BIC-DevSphere:develop' into develop
2 parents a6e2bd0 + c253c07 commit bd25b1f

3 files changed

Lines changed: 264 additions & 215 deletions

File tree

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
-- CreateEnum
2+
CREATE TYPE "public"."ActionType" AS ENUM ('CREATE', 'UPDATE', 'DELETE');
3+
4+
-- CreateEnum
5+
CREATE TYPE "public"."Models" AS ENUM ('USER', 'MEMBER', 'EVENT', 'PROJECT', 'PROJECTCONTRIBUTORS', 'EVENTSCHEDULE', 'CONTRIBUTOR', 'TAG');
6+
7+
-- CreateEnum
8+
CREATE TYPE "public"."EventImageType" AS ENUM ('PROMOTIONAL', 'GALLERY', 'GUESTS');
9+
10+
-- CreateTable
11+
CREATE TABLE "public"."event_images" (
12+
"id" TEXT NOT NULL,
13+
"image_url" TEXT,
14+
"image_type" "public"."EventImageType" NOT NULL,
15+
"uploaded_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
16+
"deleted_at" TIMESTAMP(3),
17+
"event_id" TEXT NOT NULL,
18+
19+
CONSTRAINT "event_images_pkey" PRIMARY KEY ("id")
20+
);
21+
22+
-- CreateTable
23+
CREATE TABLE "public"."AuditLogs" (
24+
"id" TEXT NOT NULL,
25+
"action" "public"."ActionType" NOT NULL DEFAULT 'CREATE',
26+
"userId" TEXT NOT NULL,
27+
"entity" "public"."Models" NOT NULL,
28+
"entityId" TEXT NOT NULL,
29+
"timestamp" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
30+
"changes" JSONB,
31+
32+
CONSTRAINT "AuditLogs_pkey" PRIMARY KEY ("id")
33+
);
34+
35+
-- CreateIndex
36+
CREATE INDEX "AuditLogs_timestamp_idx" ON "public"."AuditLogs"("timestamp");
37+
38+
-- CreateIndex
39+
CREATE INDEX "AuditLogs_userId_idx" ON "public"."AuditLogs"("userId");
40+
41+
-- CreateIndex
42+
CREATE INDEX "AuditLogs_entity_entityId_idx" ON "public"."AuditLogs"("entity", "entityId");
43+
44+
-- AddForeignKey
45+
ALTER TABLE "public"."event_images" ADD CONSTRAINT "event_images_event_id_fkey" FOREIGN KEY ("event_id") REFERENCES "public"."events"("id") ON DELETE CASCADE ON UPDATE CASCADE;
46+
47+
-- AddForeignKey
48+
ALTER TABLE "public"."AuditLogs" ADD CONSTRAINT "AuditLogs_userId_fkey" FOREIGN KEY ("userId") REFERENCES "public"."user"("id") ON DELETE CASCADE ON UPDATE CASCADE;

prisma/schema/auth.prisma

Lines changed: 0 additions & 215 deletions
This file was deleted.

0 commit comments

Comments
 (0)