all repos — stealth-developers @ faa90c2a0c29f0a32a860279b4325fba5d01f646

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(),
});