feat: added new property to existing shortcode model in prisma schema

This commit is contained in:
Balu Babu
2023-10-25 19:38:06 +05:30
parent d1c9c3583f
commit 28a88759c6
3 changed files with 19 additions and 2 deletions

View File

@@ -107,7 +107,7 @@ services:
build:
dockerfile: packages/hoppscotch-backend/Dockerfile
context: .
target: prod
target: dev
env_file:
- ./.env
restart: always
@@ -117,7 +117,7 @@ services:
- PORT=3000
volumes:
# Uncomment the line below when modifying code. Only applicable when using the "dev" target.
# - ./packages/hoppscotch-backend/:/usr/src/app
- ./packages/hoppscotch-backend/:/usr/src/app
- /usr/src/app/node_modules/
depends_on:
hoppscotch-db:

View File

@@ -0,0 +1,5 @@
-- AlterTable
ALTER TABLE "Shortcode" ADD COLUMN "properties" JSONB;
-- AddForeignKey
ALTER TABLE "Shortcode" ADD CONSTRAINT "Shortcode_creatorUid_fkey" FOREIGN KEY ("creatorUid") REFERENCES "User"("uid") ON DELETE SET NULL ON UPDATE CASCADE;

View File

@@ -67,10 +67,21 @@ model TeamRequest {
updatedOn DateTime @updatedAt @db.Timestamp(3)
}
// model Shortcode {
// id String @id
// request Json
// creatorUid String?
// createdOn DateTime @default(now())
// @@unique(fields: [id, creatorUid], name: "creator_uid_shortcode_unique")
// }
model Shortcode {
id String @id
request Json
properties Json? // if properties is null, SharedRequest is an embed else shortcode
creatorUid String?
User User? @relation(fields: [creatorUid], references: [uid])
createdOn DateTime @default(now())
@@unique(fields: [id, creatorUid], name: "creator_uid_shortcode_unique")
@@ -102,6 +113,7 @@ model User {
currentGQLSession Json?
createdOn DateTime @default(now()) @db.Timestamp(3)
invitedUsers InvitedUsers[]
shortcodes Shortcode[]
}
model Account {