import { sql } from "drizzle-orm"; import { integer, sqliteTable, text } from "drizzle-orm/sqlite-core"; // Tile registry for the signed-in launcher (`/`). A row identifies a // navigation target, not an OAuth identity, so an app fronted by // Cloudflare Access can have a tile without being a tessera OAuth // client. `/api/launcher` filters on `enabled = true` plus a safe http(s) // `url`; `icon`/`tint` are display-only with fallback rendering. export const launcherApps = sqliteTable("launcher_apps", { id: text("id").primaryKey(), name: text("name").notNull(), url: text("url").notNull(), icon: text("icon"), tint: text("tint"), enabled: integer("enabled", { mode: "boolean" }).default(true).notNull(), createdAt: integer("created_at", { mode: "timestamp_ms" }) .default(sql`(cast(unixepoch('subsecond') * 1000 as integer))`) .notNull(), updatedAt: integer("updated_at", { mode: "timestamp_ms" }) .default(sql`(cast(unixepoch('subsecond') * 1000 as integer))`) .$onUpdate(() => /* @__PURE__ */ new Date()) .notNull(), });