Skip to content

Commit

Permalink
refactor: View -> ConfigView
Browse files Browse the repository at this point in the history
  • Loading branch information
bprusinowski committed Jun 17, 2024
1 parent e42556e commit 9656256
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/db/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down
6 changes: 3 additions & 3 deletions app/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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 {
Expand Down

0 comments on commit 9656256

Please sign in to comment.