Skip to content

Commit 339033e

Browse files
authored
Merge pull request #7 from typelets/feat/diagram-notes-support
What this does Adds support for diagram notes in the API. Users can now create notes with `type: "diagram"` and filter notes by type. Why it matters - Enables frontend to distinguish between text notes and visual content (diagrams, charts, etc.) - Fully backwards compatible - existing notes automatically get `type: "note"` - Includes filtering API so users can view just diagrams or just notes
2 parents df926b3 + 0333dda commit 339033e

File tree

10 files changed

+653
-1
lines changed

10 files changed

+653
-1
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
ALTER TABLE "file_attachments" DROP CONSTRAINT "file_attachments_note_id_fkey";
2+
--> statement-breakpoint
3+
ALTER TABLE "folders" DROP CONSTRAINT "folders_parent_id_folders_id_fk";
4+
--> statement-breakpoint
5+
DROP INDEX "idx_file_attachments_note_id";--> statement-breakpoint
6+
ALTER TABLE "file_attachments" ALTER COLUMN "note_id" SET NOT NULL;--> statement-breakpoint
7+
ALTER TABLE "file_attachments" ALTER COLUMN "uploaded_at" SET NOT NULL;--> statement-breakpoint
8+
ALTER TABLE "notes" ALTER COLUMN "tags" SET DEFAULT '{}';--> statement-breakpoint
9+
ALTER TABLE "notes" ALTER COLUMN "salt" SET DATA TYPE text;--> statement-breakpoint
10+
ALTER TABLE "notes" ADD COLUMN "type" text DEFAULT 'note' NOT NULL;--> statement-breakpoint
11+
ALTER TABLE "file_attachments" ADD CONSTRAINT "file_attachments_note_id_notes_id_fk" FOREIGN KEY ("note_id") REFERENCES "public"."notes"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
12+
CREATE INDEX "idx_folders_user_id" ON "folders" USING btree ("user_id");--> statement-breakpoint
13+
CREATE INDEX "idx_folders_user_sort" ON "folders" USING btree ("user_id","sort_order");--> statement-breakpoint
14+
CREATE INDEX "idx_notes_user_id" ON "notes" USING btree ("user_id");--> statement-breakpoint
15+
CREATE INDEX "idx_notes_folder_id" ON "notes" USING btree ("folder_id");--> statement-breakpoint
16+
CREATE INDEX "idx_notes_user_updated" ON "notes" USING btree ("user_id","updated_at" DESC NULLS LAST);--> statement-breakpoint
17+
CREATE INDEX "idx_notes_type" ON "notes" USING btree ("type");--> statement-breakpoint
18+
CREATE INDEX "idx_file_attachments_note_id" ON "file_attachments" USING btree ("note_id");

0 commit comments

Comments
 (0)