all repos — stealth-developers @ 13b0369f9ad6065bdfc782fd9e3938348c651ece

src/database/schema/sessions.ts (view raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
import { sqliteTable, text, integer } from "drizzle-orm/sqlite-core";
import { sql } from "drizzle-orm";

export const sessions = sqliteTable("sessions", {
	id: text("id").primaryKey(),
	userId: text("user_id").notNull(),
	username: text("username").notNull(),
	createdAt: integer("created_at", { mode: "timestamp" })
		.default(sql`(unixepoch())`)
		.notNull(),
});