From 96562567bd28ef53060844f0f9b528bf1993ea5d Mon Sep 17 00:00:00 2001 From: Bartosz Prusinowski Date: Mon, 17 Jun 2024 10:14:17 +0200 Subject: [PATCH] refactor: View -> ConfigView --- app/db/config.ts | 2 +- app/prisma/schema.prisma | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/db/config.ts b/app/db/config.ts index d920ce707..b06cc3834 100644 --- a/app/db/config.ts +++ b/app/db/config.ts @@ -207,7 +207,7 @@ export const getConfigViewCount = async (configKey: string) => { * Increase the view count of a config. */ export const increaseConfigViewCount = async (configKey: string) => { - await prisma.view.create({ + await prisma.configView.create({ data: { config_key: configKey, }, diff --git a/app/prisma/schema.prisma b/app/prisma/schema.prisma index 445554d53..2888643d9 100644 --- a/app/prisma/schema.prisma +++ b/app/prisma/schema.prisma @@ -23,7 +23,7 @@ model Config { user User? @relation(fields: [user_id], references: [id]) user_id Int? - views View[] + views ConfigView[] published_state PUBLISHED_STATE @default(PUBLISHED) @@ -39,14 +39,14 @@ model User { @@map("users") } -model View { +model ConfigView { id Int @id @default(autoincrement()) viewed_at DateTime @default(now()) @db.Timestamp(6) config Config @relation(fields: [config_key], references: [key]) config_key String - @@map("view") + @@map("config_view") } model OldMigrations {