fix: lazily import sharp to fix commonjs error
This commit is contained in:
@@ -12,7 +12,9 @@ export const userTable = sqliteTable("user", {
|
||||
id: text()
|
||||
.primaryKey(),
|
||||
createdAt: integer("created_at", { mode: "timestamp" })
|
||||
.default(sql`(current_timestamp)`)
|
||||
.default(sql`
|
||||
(CURRENT_TIMESTAMP)
|
||||
`)
|
||||
.notNull(),
|
||||
email: text()
|
||||
.notNull(),
|
||||
@@ -24,7 +26,9 @@ export const sessionTable = sqliteTable("session", {
|
||||
id: text("id")
|
||||
.primaryKey(),
|
||||
createdAt: integer("created_at", { mode: "timestamp_ms" }).default(
|
||||
sql`(current_timestamp)`,
|
||||
sql`
|
||||
(CURRENT_TIMESTAMP)
|
||||
`,
|
||||
),
|
||||
expiresAt: integer("expires_at", { mode: "timestamp" })
|
||||
.notNull(),
|
||||
@@ -38,12 +42,16 @@ export const performanceTable = sqliteTable("performance", {
|
||||
time: int().notNull(),
|
||||
createdAt: integer("created_at", {
|
||||
mode: "timestamp_ms",
|
||||
}).default(sql`(STRFTIME('%s', 'now') * 1000)`),
|
||||
}).default(sql`
|
||||
(STRFTIME('%s', 'now') * 1000)
|
||||
`),
|
||||
});
|
||||
|
||||
export const imageTable = sqliteTable("image", {
|
||||
createdAt: integer("created_at", { mode: "timestamp" }).default(
|
||||
sql`(unixepoch())`,
|
||||
sql`
|
||||
(unixepoch())
|
||||
`,
|
||||
),
|
||||
url: text().notNull(),
|
||||
average: text().notNull(),
|
||||
@@ -70,7 +78,9 @@ export const cacheTable = sqliteTable("cache", {
|
||||
json: text({ mode: "json" }),
|
||||
binary: blob(),
|
||||
createdAt: integer("created_at", { mode: "timestamp" }).default(
|
||||
sql`(current_timestamp)`,
|
||||
sql`
|
||||
(CURRENT_TIMESTAMP)
|
||||
`,
|
||||
),
|
||||
expiresAt: integer("expires_at", { mode: "timestamp" }),
|
||||
}, (table) => {
|
||||
|
||||
Reference in New Issue
Block a user