feat:basic auth
This commit is contained in:
@@ -1,6 +1,20 @@
|
||||
import { pgTable, serial, integer } from 'drizzle-orm/pg-core';
|
||||
import { pgTable, serial, integer, text, timestamp } from 'drizzle-orm/pg-core';
|
||||
|
||||
export const user = pgTable('user', {
|
||||
id: serial('id').primaryKey(),
|
||||
age: integer('age')
|
||||
id: text('id').primaryKey(),
|
||||
age: integer('age'),
|
||||
username: text('username').notNull().unique(),
|
||||
passwordHash: text('password_hash').notNull()
|
||||
});
|
||||
|
||||
export const session = pgTable('session', {
|
||||
id: text('id').primaryKey(),
|
||||
userId: text('user_id')
|
||||
.notNull()
|
||||
.references(() => user.id),
|
||||
expiresAt: timestamp('expires_at', { withTimezone: true, mode: 'date' }).notNull()
|
||||
});
|
||||
|
||||
export type Session = typeof session.$inferSelect;
|
||||
|
||||
export type User = typeof user.$inferSelect;
|
||||
|
||||
Reference in New Issue
Block a user