bruh
This commit is contained in:
parent
a4000a589a
commit
b3ff1903b1
20 changed files with 498 additions and 124 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue