Skip to content

Commit

Permalink
added updatedAt, migration redone
Browse files Browse the repository at this point in the history
  • Loading branch information
danimorera committed Apr 25, 2023
1 parent 9c4a09f commit b562284
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ CREATE TABLE "viewed_resource" (
"user_id" TEXT NOT NULL,
"resource_id" TEXT NOT NULL,
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updated_at" TIMESTAMP(3) NOT NULL,

CONSTRAINT "viewed_resource_pkey" PRIMARY KEY ("user_id","resource_id")
);
Expand Down
1 change: 1 addition & 0 deletions back/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ model ViewedResource {
resource Resource @relation(fields: [resourceId], references: [id])
resourceId String @map("resource_id")
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @updatedAt @map("updated_at")
@@id([userId, resourceId])
@@map("viewed_resource")
Expand Down

0 comments on commit b562284

Please sign in to comment.