Files
GearBox/drizzle-pg/0010_yielding_random.sql
Jean-Luc Makiola 8cefdf625b feat(38-01): schema parentId + tag service CRUD + cycle detection
- Add parentId self-ref FK to tags table (ON DELETE SET NULL)
- Generate Drizzle migration 0010_yielding_random.sql
- Extend tag.service.ts with getAdminTags, getTagWithCounts, createTag, updateTag, deleteTag, isDescendant
- Add service tests (14 tests, all pass)
2026-04-19 22:26:47 +02:00

2 lines
235 B
SQL

ALTER TABLE "tags" ADD COLUMN "parent_id" integer;--> statement-breakpoint
ALTER TABLE "tags" ADD CONSTRAINT "tags_parent_id_tags_id_fk" FOREIGN KEY ("parent_id") REFERENCES "public"."tags"("id") ON DELETE set null ON UPDATE no action;