diff --git a/lib/db/schema-auth.ts b/lib/db/schema-auth.ts new file mode 100644 index 0000000000..85cba3f57a --- /dev/null +++ b/lib/db/schema-auth.ts @@ -0,0 +1,10 @@ +import type { InferSelectModel } from 'drizzle-orm'; +import { pgTable, varchar, uuid } from 'drizzle-orm/pg-core'; + +export const user = pgTable('User', { + id: uuid('id').primaryKey().notNull().defaultRandom(), + email: varchar('email', { length: 64 }).notNull(), + password: varchar('password', { length: 64 }), +}); + +export type User = InferSelectModel; diff --git a/lib/db/schema.ts b/lib/db/schema.ts index 1228aab9af..061a66cb3b 100644 --- a/lib/db/schema.ts +++ b/lib/db/schema.ts @@ -10,14 +10,10 @@ import { foreignKey, boolean, } from 'drizzle-orm/pg-core'; +import { user } from './schema-auth'; -export const user = pgTable('User', { - id: uuid('id').primaryKey().notNull().defaultRandom(), - email: varchar('email', { length: 64 }).notNull(), - password: varchar('password', { length: 64 }), -}); - -export type User = InferSelectModel; +export { user } from './schema-auth'; +export type { User } from './schema-auth'; export const chat = pgTable('Chat', { id: uuid('id').primaryKey().notNull().defaultRandom(),