Files
ProjectE/drizzle/0009_notifications.sql
T
Hermes 7041906e7d feat(plane-lift): API routes, UI components, migrations — Phase 2
New API routes:
- statuses.ts: CRUD for custom task statuses
- automations.ts: automation rules engine
- timeline.ts: entity timeline/activity view
- activity.ts: activity feed endpoint

New UI components:
- gantt/: gantt chart (6 files: chart, task-bar, milestone, timeline, deps, utils)
- automation-rule-builder.tsx: visual rule editor
- notification-center.tsx: in-app notifications
- quick-add-bar.tsx: global quick-add
- entities/: detail-page, activity, comments, inline-edit, note-editor
- tasks/: recurrence-picker

New hooks:
- use-optimistic-patch.ts: optimistic UI updates

New libs:
- nlp-parser.ts + test: natural language task parsing
- notify.ts: notification dispatch
- automation-engine.ts: rule evaluation

DB migrations:
- 0007_custom_task_statuses.sql
- 0008_automation_rules.sql
- 0009_notifications.sql
- migrate-task-statuses.ts: backfill script

Modified:
- tasks.ts: plane-lift integration (stateId/moduleId/cycleId)
- analytics.ts: updated for new schema
- canvas/$id.tsx: restored
2026-09-07 18:09:03 +00:00

21 lines
1.2 KiB
SQL

CREATE TABLE "notifications" (
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
"user_id" uuid NOT NULL,
"workspace_id" uuid,
"type" text NOT NULL,
"title" text NOT NULL,
"body" text,
"entity_type" text,
"entity_id" uuid,
"read_at" timestamp with time zone,
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
"deleted_at" timestamp with time zone
);
--> statement-breakpoint
ALTER TABLE "notifications" ADD CONSTRAINT "notifications_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "notifications" ADD CONSTRAINT "notifications_workspace_id_domains_id_fk" FOREIGN KEY ("workspace_id") REFERENCES "public"."domains"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
CREATE INDEX "notifications_user_id_idx" ON "notifications" USING btree ("user_id");--> statement-breakpoint
CREATE INDEX "notifications_user_read_idx" ON "notifications" USING btree ("user_id","read_at");--> statement-breakpoint
CREATE INDEX "notifications_workspace_id_idx" ON "notifications" USING btree ("workspace_id");--> statement-breakpoint
CREATE INDEX "notifications_entity_idx" ON "notifications" USING btree ("entity_type","entity_id");