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)
This commit is contained in:
2
drizzle-pg/0010_yielding_random.sql
Normal file
2
drizzle-pg/0010_yielding_random.sql
Normal file
@@ -0,0 +1,2 @@
|
||||
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;
|
||||
Reference in New Issue
Block a user