chore: fixed issue with updatedOn field in shortcodes model

This commit is contained in:
Balu Babu
2023-11-06 17:52:10 +05:30
parent 61efaaa248
commit 032164f263
4 changed files with 5 additions and 7 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

@@ -2,12 +2,11 @@
Warnings:
- A unique constraint covering the columns `[id]` on the table `Shortcode` will be added. If there are existing duplicate values, this will fail.
- Added the required column `updatedOn` to the `Shortcode` table without a default value. This is not possible if the table is not empty.
*/
-- AlterTable
ALTER TABLE "Shortcode" ADD COLUMN "embedProperties" JSONB,
ADD COLUMN "updatedOn" TIMESTAMP(3) NOT NULL;
ADD COLUMN "updatedOn" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP;
-- CreateIndex
CREATE UNIQUE INDEX "Shortcode_id_key" ON "Shortcode"("id");

View File

@@ -74,8 +74,7 @@ model Shortcode {
creatorUid String?
User User? @relation(fields: [creatorUid], references: [uid])
createdOn DateTime @default(now())
updatedOn DateTime @updatedAt
updatedOn DateTime @updatedAt @default(now())
@@unique(fields: [id, creatorUid], name: "creator_uid_shortcode_unique")
}

View File

@@ -19,7 +19,7 @@ export class Shortcode {
properties: string;
@Field({
description: 'Timestamp of when the SharedRequest was created',
description: 'Timestamp of when the Shortcode was created',
})
createdOn: Date;
}