From 85c42da31c87d068ba318033dbd46db3ecff3fff Mon Sep 17 00:00:00 2001 From: Balu Babu Date: Thu, 30 Nov 2023 13:54:32 +0530 Subject: [PATCH] feat: added new columns into the TeamCollections and UserCollections models --- .../20231130082054_collection_headers/migration.sql | 5 +++++ packages/hoppscotch-backend/prisma/schema.prisma | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 packages/hoppscotch-backend/prisma/migrations/20231130082054_collection_headers/migration.sql diff --git a/packages/hoppscotch-backend/prisma/migrations/20231130082054_collection_headers/migration.sql b/packages/hoppscotch-backend/prisma/migrations/20231130082054_collection_headers/migration.sql new file mode 100644 index 000000000..0276e9099 --- /dev/null +++ b/packages/hoppscotch-backend/prisma/migrations/20231130082054_collection_headers/migration.sql @@ -0,0 +1,5 @@ +-- AlterTable +ALTER TABLE "TeamCollection" ADD COLUMN "data" JSONB; + +-- AlterTable +ALTER TABLE "UserCollection" ADD COLUMN "data" JSONB; diff --git a/packages/hoppscotch-backend/prisma/schema.prisma b/packages/hoppscotch-backend/prisma/schema.prisma index 68dfed992..1c945fa2d 100644 --- a/packages/hoppscotch-backend/prisma/schema.prisma +++ b/packages/hoppscotch-backend/prisma/schema.prisma @@ -43,6 +43,7 @@ model TeamInvitation { model TeamCollection { id String @id @default(cuid()) parentID String? + data Json? parent TeamCollection? @relation("TeamCollectionChildParent", fields: [parentID], references: [id]) children TeamCollection[] @relation("TeamCollectionChildParent") requests TeamRequest[] @@ -74,7 +75,8 @@ model Shortcode { creatorUid String? User User? @relation(fields: [creatorUid], references: [uid]) createdOn DateTime @default(now()) - updatedOn DateTime @updatedAt @default(now()) + updatedOn DateTime @default(now()) @updatedAt + @@unique(fields: [id, creatorUid], name: "creator_uid_shortcode_unique") } @@ -195,6 +197,7 @@ model UserCollection { userUid String user User @relation(fields: [userUid], references: [uid], onDelete: Cascade) title String + data Json? orderIndex Int type ReqType createdOn DateTime @default(now()) @db.Timestamp(3)