feat(product-family): link-level tags (origin_good_tags) with manual override + member detail enrichment

This commit is contained in:
yeuimu
2026-08-28 16:00:46 +08:00
parent 37b52c5ebb
commit 08201f18a4
11 changed files with 477 additions and 87 deletions
@@ -0,0 +1,25 @@
-- AlterTable
ALTER TABLE "origin_goods" ADD COLUMN "tags_manual" BOOLEAN NOT NULL DEFAULT false;
-- CreateTable
CREATE TABLE "origin_good_tags" (
"id" BIGSERIAL NOT NULL,
"origin_good_id" BIGINT NOT NULL,
"tag_id" BIGINT NOT NULL,
"manual" BOOLEAN NOT NULL DEFAULT false,
"created_at" TIMESTAMPTZ(6) NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT "origin_good_tags_pkey" PRIMARY KEY ("id")
);
-- CreateIndex
CREATE INDEX "origin_good_tags_tag_id_idx" ON "origin_good_tags"("tag_id");
-- CreateIndex
CREATE UNIQUE INDEX "origin_good_tags_origin_good_id_tag_id_key" ON "origin_good_tags"("origin_good_id", "tag_id");
-- AddForeignKey
ALTER TABLE "origin_good_tags" ADD CONSTRAINT "origin_good_tags_origin_good_id_fkey" FOREIGN KEY ("origin_good_id") REFERENCES "origin_goods"("origin_good_id") ON DELETE CASCADE ON UPDATE NO ACTION;
-- AddForeignKey
ALTER TABLE "origin_good_tags" ADD CONSTRAINT "origin_good_tags_tag_id_fkey" FOREIGN KEY ("tag_id") REFERENCES "tags"("tag_id") ON DELETE CASCADE ON UPDATE NO ACTION;