feat:basic auth

This commit is contained in:
2025-09-26 18:47:03 +02:00
parent 3cdb35b763
commit 7e4570cf0e
10 changed files with 308 additions and 10 deletions

View File

@@ -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;