mirror of
https://github.com/ArthurDanjou/artsite.git
synced 2026-01-21 08:23:21 +01:00
Implementing Drizzle to add views and like for post
This commit is contained in:
9
server/database/schema.ts
Normal file
9
server/database/schema.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { integer, sqliteTable, text } from 'drizzle-orm/sqlite-core'
|
||||
import { sql } from 'drizzle-orm'
|
||||
|
||||
export const posts = sqliteTable('posts', {
|
||||
slug: text('slug').primaryKey(),
|
||||
likes: integer('likes').default(0),
|
||||
views: integer('views').default(0),
|
||||
createdAt: text('created_at').default(sql`(CURRENT_DATE)`)
|
||||
})
|
||||
Reference in New Issue
Block a user