- 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)
2 lines
235 B
SQL
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; |