a fun bot for the hc slack
1import { sqliteTable, text, integer } from "drizzle-orm/sqlite-core";
2
3// Define the takes table
4export const takes = sqliteTable("takes", {
5 id: text("id").primaryKey(),
6 userId: text("user_id").notNull(),
7 ts: text("ts"),
8 status: text("status").notNull().default("active"), // active, paused, waitingUpload, completed
9 startedAt: integer("started_at", { mode: "timestamp" }).notNull(),
10 pausedAt: integer("paused_at", { mode: "timestamp" }),
11 completedAt: integer("completed_at", { mode: "timestamp" }),
12 takeUploadedAt: integer("take_uploaded_at", { mode: "timestamp" }),
13 takeUrl: text("take_url"),
14 takeThumbUrl: text("take_thumb_url"),
15 multiplier: text("multiplier").notNull().default("1.0"),
16 durationMinutes: integer("duration_minutes").notNull().default(5), // 5 minutes for testing (should be 90)
17 pausedTimeMs: integer("paused_time_ms").notNull().default(0), // cumulative paused time
18 notes: text("notes"),
19 description: text("description"),
20 notifiedLowTime: integer("notified_low_time", { mode: "boolean" }).default(
21 false,
22 ), // has user been notified about low time
23 notifiedPauseExpiration: integer("notified_pause_expiration", {
24 mode: "boolean",
25 }).default(false), // has user been notified about pause expiration
26});