File
Blob: src/worker/db/schema/launcher-apps.ts
| 1 | import { sql } from "drizzle-orm"; |
| 2 | import { integer, sqliteTable, text } from "drizzle-orm/sqlite-core"; |
| 3 | |
| 4 | // Tile registry for the signed-in launcher (`/`). A row identifies a |
| 5 | // navigation target, not an OAuth identity, so an app fronted by |
| 6 | // Cloudflare Access can have a tile without being a tessera OAuth |
| 7 | // client. `/api/launcher` filters on `enabled = true` plus a safe http(s) |
| 8 | // `url`; `icon`/`tint` are display-only with fallback rendering. |
| 9 | export const launcherApps = sqliteTable("launcher_apps", { |
| 10 | id: text("id").primaryKey(), |
| 11 | name: text("name").notNull(), |
| 12 | url: text("url").notNull(), |
| 13 | icon: text("icon"), |
| 14 | tint: text("tint"), |
| 15 | enabled: integer("enabled", { mode: "boolean" }).default(true).notNull(), |
| 16 | createdAt: integer("created_at", { mode: "timestamp_ms" }) |
| 17 | .default(sql`(cast(unixepoch('subsecond') * 1000 as integer))`) |
| 18 | .notNull(), |
| 19 | updatedAt: integer("updated_at", { mode: "timestamp_ms" }) |
| 20 | .default(sql`(cast(unixepoch('subsecond') * 1000 as integer))`) |
| 21 | .$onUpdate(() => /* @__PURE__ */ new Date()) |
| 22 | .notNull(), |
| 23 | }); |