This commit is contained in:
Lara 2025-04-06 20:15:45 +03:00
parent a4000a589a
commit b3ff1903b1
Signed by: laratheprotogen
GPG key ID: 5C0296EB3165F98B
20 changed files with 498 additions and 124 deletions

View file

@ -2,9 +2,27 @@ import { sql } from 'drizzle-orm';
import { sqliteTable, text, integer } from 'drizzle-orm/sqlite-core';
export const user = sqliteTable('user', {
id: integer('id').primaryKey({ autoIncrement: true}),
id: text('id').primaryKey(),
did: text('did').notNull(),
handle: text('handle').notNull(),
created_at: text('created_at').notNull().default(sql`CURRENT_TIMESTAMP`),
updated_at: text('updated_at').notNull().default(sql`CURRENT_TIMESTAMP`),
created_at: text('created_at')
.notNull()
.default(sql`CURRENT_TIMESTAMP`),
updated_at: text('updated_at')
.notNull()
.default(sql`CURRENT_TIMESTAMP`),
username: text('username').notNull().unique(),
passwordHash: text('password_hash').notNull()
});
export const session = sqliteTable('session', {
id: text('id').primaryKey(),
userId: text('user_id')
.notNull()
.references(() => user.id),
expiresAt: integer('expires_at', { mode: 'timestamp' }).notNull()
});
export type Session = typeof session.$inferSelect;
export type User = typeof user.$inferSelect;