v0.5.1 — Reminders, plant groups, location views, Wikipedia photos, Docker deploy

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Bonna Moon
2026-06-15 20:53:03 -05:00
parent e3f6a8ec92
commit 04dec2a198
32 changed files with 1988 additions and 181 deletions

View File

@@ -0,0 +1,38 @@
-- Moon Base v0.3 — recurring tasks / reminders
CREATE TYPE "TaskCategory" AS ENUM ('GARDEN', 'HOME', 'EQUIPMENT', 'OTHER');
CREATE TYPE "RecurrenceType" AS ENUM ('ONCE', 'CUSTOM', 'MONTHLY', 'YEARLY');
CREATE TABLE "Task" (
"id" TEXT NOT NULL,
"title" TEXT NOT NULL,
"notes" TEXT,
"category" "TaskCategory" NOT NULL DEFAULT 'GARDEN',
"plantId" TEXT,
-- Recurrence
"recurrence" "RecurrenceType" NOT NULL DEFAULT 'YEARLY',
"intervalDays" INTEGER, -- for CUSTOM: every N days
"month" INTEGER, -- 1-12: for YEARLY (which month) or MONTHLY (ignored)
-- Scheduling
"nextDue" TIMESTAMP(3) NOT NULL,
"lastDone" TIMESTAMP(3),
"active" BOOLEAN NOT NULL DEFAULT true,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,
CONSTRAINT "Task_pkey" PRIMARY KEY ("id"),
CONSTRAINT "Task_plantId_fkey" FOREIGN KEY ("plantId") REFERENCES "Plant"("id") ON DELETE SET NULL ON UPDATE CASCADE
);
CREATE INDEX "Task_nextDue_idx" ON "Task"("nextDue");
CREATE INDEX "Task_plantId_idx" ON "Task"("plantId");
CREATE INDEX "Task_active_idx" ON "Task"("active");
CREATE TABLE "TaskCompletion" (
"id" TEXT NOT NULL,
"taskId" TEXT NOT NULL,
"doneAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"notes" TEXT,
"actorId" TEXT,
CONSTRAINT "TaskCompletion_pkey" PRIMARY KEY ("id"),
CONSTRAINT "TaskCompletion_taskId_fkey" FOREIGN KEY ("taskId") REFERENCES "Task"("id") ON DELETE RESTRICT ON UPDATE CASCADE
);
CREATE INDEX "TaskCompletion_taskId_idx" ON "TaskCompletion"("taskId");

View File

@@ -0,0 +1,23 @@
-- v0.4.0 — Plant groups (irises, hostas, etc.)
CREATE TABLE "PlantGroup" (
"id" TEXT NOT NULL,
"name" TEXT NOT NULL,
"notes" TEXT,
"active" BOOLEAN NOT NULL DEFAULT true,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT "PlantGroup_pkey" PRIMARY KEY ("id")
);
CREATE UNIQUE INDEX "PlantGroup_name_key" ON "PlantGroup"("name");
CREATE INDEX "PlantGroup_active_idx" ON "PlantGroup"("active");
ALTER TABLE "Plant" ADD COLUMN "groupId" TEXT;
ALTER TABLE "Plant"
ADD CONSTRAINT "Plant_groupId_fkey"
FOREIGN KEY ("groupId") REFERENCES "PlantGroup"("id")
ON DELETE SET NULL ON UPDATE CASCADE;
CREATE INDEX "Plant_groupId_idx" ON "Plant"("groupId");

View File

@@ -0,0 +1,2 @@
-- v0.5.0 — Plant image URL (fetched from Wikipedia on add/edit)
ALTER TABLE "Plant" ADD COLUMN "imageUrl" TEXT;

View File

@@ -71,6 +71,18 @@ enum PlantCategory {
OTHER
}
model PlantGroup {
id String @id @default(cuid())
name String @unique
notes String?
active Boolean @default(true)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
plants Plant[]
@@index([active])
}
model Plant {
id String @id @default(cuid())
commonName String
@@ -81,14 +93,19 @@ model Plant {
plantedAt DateTime? // when it went in the ground
source String? // where it came from ("Jung's Nursery", "from seed", "division from Mom's")
notes String? // general notes about this plant
groupId String? // optional: belongs to a PlantGroup (e.g. "Irises")
group PlantGroup? @relation(fields: [groupId], references: [id])
imageUrl String? // thumbnail fetched from Wikipedia on add/edit
active Boolean @default(true)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
logs PlantLog[]
tasks Task[]
@@index([category])
@@index([zone])
@@index([active])
@@index([groupId])
}
enum PlantLogType {
@@ -100,6 +117,57 @@ enum PlantLogType {
DIED // plant died or was removed
}
// ---------------------------------------------------------------------------
// Tasks / reminders
// ---------------------------------------------------------------------------
enum TaskCategory {
GARDEN
HOME
EQUIPMENT
OTHER
}
enum RecurrenceType {
ONCE // one-time task, no repeat
CUSTOM // every N days (intervalDays)
MONTHLY // same day every month (uses nextDue day-of-month)
YEARLY // same month every year (month field)
}
model Task {
id String @id @default(cuid())
title String
notes String?
category TaskCategory @default(GARDEN)
plantId String?
plant Plant? @relation(fields: [plantId], references: [id])
recurrence RecurrenceType @default(YEARLY)
intervalDays Int? // for CUSTOM: every N days
month Int? // 112: for YEARLY, which month
nextDue DateTime
lastDone DateTime?
active Boolean @default(true)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
completions TaskCompletion[]
@@index([nextDue])
@@index([plantId])
@@index([active])
}
model TaskCompletion {
id String @id @default(cuid())
taskId String
task Task @relation(fields: [taskId], references: [id])
doneAt DateTime @default(now())
notes String?
actorId String?
@@index([taskId])
}
model PlantLog {
id String @id @default(cuid())
plantId String