-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add: last message content and time in list rooms, author avatar in ge… (
#75)
- Loading branch information
Showing
10 changed files
with
181 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
backend/code/prisma/migrations/20231030183113_/migration.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
Warnings: | ||
- A unique constraint covering the columns `[createdAt]` on the table `messages` will be added. If there are existing duplicate values, this will fail. | ||
- A unique constraint covering the columns `[Username]` on the table `users` will be added. If there are existing duplicate values, this will fail. | ||
*/ | ||
-- CreateEnum | ||
CREATE TYPE "NotifType" AS ENUM ('addFriend'); | ||
|
||
-- DropForeignKey | ||
ALTER TABLE "messages" DROP CONSTRAINT "messages_roomId_fkey"; | ||
|
||
-- AlterTable | ||
ALTER TABLE "blocked_friends" ADD COLUMN "dmRoomId" TEXT; | ||
|
||
-- AlterTable | ||
ALTER TABLE "room_members" ADD COLUMN "bannedAt" TIMESTAMP(3); | ||
|
||
-- AlterTable | ||
ALTER TABLE "users" ADD COLUMN "tfaSecret" TEXT, | ||
ADD COLUMN "tfaStatus" BOOLEAN NOT NULL DEFAULT false; | ||
|
||
-- CreateTable | ||
CREATE TABLE "notifications" ( | ||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"id" TEXT NOT NULL, | ||
"recipientId" TEXT NOT NULL, | ||
"content" "NotifType" NOT NULL, | ||
"is_read" BOOLEAN NOT NULL DEFAULT false, | ||
"readAt" TIMESTAMP(3), | ||
|
||
CONSTRAINT "notifications_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "notifications_createdAt_key" ON "notifications"("createdAt"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "messages_createdAt_key" ON "messages"("createdAt"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "users_Username_key" ON "users"("Username"); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "matches" ADD CONSTRAINT "matches_participant2Id_fkey" FOREIGN KEY ("participant2Id") REFERENCES "users"("userId") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "messages" ADD CONSTRAINT "messages_roomId_fkey" FOREIGN KEY ("roomId") REFERENCES "rooms"("id") ON DELETE CASCADE ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "messages" ADD CONSTRAINT "messages_authorId_fkey" FOREIGN KEY ("authorId") REFERENCES "users"("userId") ON DELETE RESTRICT ON UPDATE CASCADE; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters