Skip to content

Commit

Permalink
Add hashedPassword and make email unique
Browse files Browse the repository at this point in the history
  • Loading branch information
mauriciabad committed Oct 22, 2023
1 parent 0b801b4 commit ea67989
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/server/db/schema/users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,11 @@ import {
varchar,
} from 'drizzle-orm/mysql-core'

/*
* NextAuth tables, see https://authjs.dev/reference/adapter/drizzle
*/

export const users = mysqlTable('user', {
id: varchar('id', { length: 255 }).notNull().primaryKey(),
name: varchar('name', { length: 255 }),
email: varchar('email', { length: 255 }).notNull(),
hashedPassword: varchar('hashedPassword', { length: 255 }),
email: varchar('email', { length: 255 }).unique().notNull(),
emailVerified: timestamp('emailVerified', {
mode: 'date',
fsp: 3,
Expand All @@ -33,8 +30,8 @@ export const accounts = mysqlTable(
.notNull(),
provider: varchar('provider', { length: 255 }).notNull(),
providerAccountId: varchar('providerAccountId', { length: 255 }).notNull(),
refresh_token: varchar('refresh_token', { length: 255 }),
access_token: varchar('access_token', { length: 255 }),
refresh_token: text('refresh_token'),
access_token: text('access_token'),
expires_at: int('expires_at'),
token_type: varchar('token_type', { length: 255 }),
scope: varchar('scope', { length: 255 }),
Expand Down

0 comments on commit ea67989

Please sign in to comment.