Fix database notification untuk mobile

Fix:
- prisma/migrations/20251223084450_add_recipient_and_sender

Add:
- prisma/schema.prisma
- src/app/api/mobile/auth/device-tokens/[id]/route.ts
- src/app/api/mobile/auth/device-tokens/route.ts
- src/app/api/mobile/notification/[id]/unread-count/route.ts
- src/app/api/mobile/notification/route.ts

### No Issue
This commit is contained in:
2025-12-23 17:32:05 +08:00
parent f05571caa4
commit b2e8bc3caf
6 changed files with 374 additions and 90 deletions

View File

@@ -0,0 +1,16 @@
-- DropForeignKey
ALTER TABLE "Notifikasi" DROP CONSTRAINT "Notifikasi_userRoleId_fkey";
-- AlterTable
ALTER TABLE "Notifikasi" ADD COLUMN "recipientId" TEXT,
ADD COLUMN "senderId" TEXT,
ALTER COLUMN "userRoleId" DROP NOT NULL;
-- AddForeignKey
ALTER TABLE "Notifikasi" ADD CONSTRAINT "Notifikasi_userRoleId_fkey" FOREIGN KEY ("userRoleId") REFERENCES "MasterUserRole"("id") ON DELETE SET NULL ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "Notifikasi" ADD CONSTRAINT "Notifikasi_recipientId_fkey" FOREIGN KEY ("recipientId") REFERENCES "User"("id") ON DELETE SET NULL ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "Notifikasi" ADD CONSTRAINT "Notifikasi_senderId_fkey" FOREIGN KEY ("senderId") REFERENCES "User"("id") ON DELETE SET NULL ON UPDATE CASCADE;