Skip to content

Commit

Permalink
Fix timestamp mode in Session and VerificationCode
Browse files Browse the repository at this point in the history
tables.
  • Loading branch information
Timothy Miller committed Nov 6, 2023
1 parent 6d83f19 commit 37120ab
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/api/src/db/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ export const SessionTable = sqliteTable(
userId: text('user_id')
.notNull()
.references(() => UserTable.id),
activeExpires: integer('active_expires', { mode: "timestamp_ms" }).notNull(),
idleExpires: integer('idle_expires', { mode: "timestamp_ms" }).notNull(),
activeExpires: integer('active_expires', { mode: 'timestamp_ms' }).notNull(),
idleExpires: integer('idle_expires', { mode: 'timestamp_ms' }).notNull(),
},
(t) => ({
userIdIdx: index('idx_session_userId').on(t.userId),
Expand All @@ -71,14 +71,16 @@ export const SessionSchema = createInsertSchema(SessionTable)
export const VerificationCodeTable = sqliteTable(
'VerificationCode',
{
id: text('id').primaryKey().$defaultFn(() => createId()),
id: text('id')
.primaryKey()
.$defaultFn(() => createId()),
userId: text('user_id')
.notNull()
.unique()
.references(() => UserTable.id),
code: text('code').notNull(),
expires: integer('expires', { mode: "timestamp_ms" }).notNull(),
timeoutUntil: integer('timeout_until', { mode: "timestamp_ms" }),
expires: integer('expires', { mode: 'timestamp_ms' }).notNull(),
timeoutUntil: integer('timeout_until', { mode: 'timestamp_ms' }),
timeoutSeconds: integer('timeout_seconds').notNull().default(0),
},
(t) => ({
Expand Down

0 comments on commit 37120ab

Please sign in to comment.