Enhance Prisma schema and documentation for dashboard features
- Added new models for DashboardAccessRule and DashboardAuditLog to the Prisma schema, improving access control and logging capabilities. - Updated GuildSettings model to include timezone support. - Revised PHASE-TRACKING.md to reflect the completion of Phase 5 and outline upcoming Phase 6 features, including dashboard layout and settings framework. - Exported new phase 6 features in shared index for better modularity.
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
-- AlterTable
|
||||
ALTER TABLE "GuildSettings" ADD COLUMN "timezone" TEXT NOT NULL DEFAULT 'Europe/Berlin';
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "DashboardAccessRule" (
|
||||
"id" TEXT NOT NULL,
|
||||
"guildId" TEXT NOT NULL,
|
||||
"roleId" TEXT NOT NULL,
|
||||
"modules" JSONB NOT NULL,
|
||||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updatedAt" TIMESTAMP(3) NOT NULL,
|
||||
|
||||
CONSTRAINT "DashboardAccessRule_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "DashboardAuditLog" (
|
||||
"id" TEXT NOT NULL,
|
||||
"guildId" TEXT,
|
||||
"actorUserId" TEXT NOT NULL,
|
||||
"action" TEXT NOT NULL,
|
||||
"path" TEXT,
|
||||
"before" JSONB,
|
||||
"after" JSONB,
|
||||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
|
||||
CONSTRAINT "DashboardAuditLog_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- CreateIndex
|
||||
CREATE INDEX "DashboardAccessRule_guildId_idx" ON "DashboardAccessRule"("guildId");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "DashboardAccessRule_guildId_roleId_key" ON "DashboardAccessRule"("guildId", "roleId");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE INDEX "DashboardAuditLog_guildId_createdAt_idx" ON "DashboardAuditLog"("guildId", "createdAt");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE INDEX "DashboardAuditLog_actorUserId_createdAt_idx" ON "DashboardAuditLog"("actorUserId", "createdAt");
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "DashboardAccessRule" ADD CONSTRAINT "DashboardAccessRule_guildId_fkey" FOREIGN KEY ("guildId") REFERENCES "Guild"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "DashboardAuditLog" ADD CONSTRAINT "DashboardAuditLog_guildId_fkey" FOREIGN KEY ("guildId") REFERENCES "Guild"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
Reference in New Issue
Block a user