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

@@ -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")
}