feat: add personal todos feature
- New todos table in DB schema (title, description, priority, category, due date, completion) - Full CRUD + toggle API routes at /api/todos - Categories support with filtering - Bulk import endpoint for migration - New TodosPage with inline editing, priority badges, due date display - Add Todos to sidebar navigation - Dark mode support throughout
This commit is contained in:
@@ -175,6 +175,33 @@ export const dailySummaries = pgTable("daily_summaries", {
|
||||
export type DailySummary = typeof dailySummaries.$inferSelect;
|
||||
export type NewDailySummary = typeof dailySummaries.$inferInsert;
|
||||
|
||||
// ─── Personal Todos ───
|
||||
|
||||
export const todoPriorityEnum = pgEnum("todo_priority", [
|
||||
"high",
|
||||
"medium",
|
||||
"low",
|
||||
"none",
|
||||
]);
|
||||
|
||||
export const todos = pgTable("todos", {
|
||||
id: uuid("id").defaultRandom().primaryKey(),
|
||||
userId: text("user_id").notNull(),
|
||||
title: text("title").notNull(),
|
||||
description: text("description"),
|
||||
isCompleted: boolean("is_completed").notNull().default(false),
|
||||
priority: todoPriorityEnum("priority").notNull().default("none"),
|
||||
category: text("category"),
|
||||
dueDate: timestamp("due_date", { withTimezone: true }),
|
||||
completedAt: timestamp("completed_at", { withTimezone: true }),
|
||||
sortOrder: integer("sort_order").notNull().default(0),
|
||||
createdAt: timestamp("created_at", { withTimezone: true }).defaultNow().notNull(),
|
||||
updatedAt: timestamp("updated_at", { withTimezone: true }).defaultNow().notNull(),
|
||||
});
|
||||
|
||||
export type Todo = typeof todos.$inferSelect;
|
||||
export type NewTodo = typeof todos.$inferInsert;
|
||||
|
||||
// ─── BetterAuth tables ───
|
||||
|
||||
export const users = pgTable("users", {
|
||||
|
||||
Reference in New Issue
Block a user