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 elapsedTimeMs: integer("elapsed_time_ms").notNull().default(0),
10 targetDurationMs: integer("target_duration_ms").notNull(),
11 periods: text("periods").notNull(), // JSON string of time periods
12 lastResumeAt: integer("last_resume_at", { mode: "timestamp" }),
13 completedAt: integer("completed_at", { mode: "timestamp" }),
14 takeUploadedAt: integer("take_uploaded_at", { mode: "timestamp" }),
15 takeUrl: text("take_url"),
16 multiplier: text("multiplier").notNull().default("1.0"),
17 notes: text("notes"),
18 description: text("description"),
19 notifiedLowTime: integer("notified_low_time", { mode: "boolean" }).default(
20 false,
21 ), // has user been notified about low time
22 notifiedPauseExpiration: integer("notified_pause_expiration", {
23 mode: "boolean",
24 }).default(false), // has user been notified about pause expiration
25});