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)