-- Sync database with schema.prisma (missing columns/table from earlier iterations)

-- AlterTable
ALTER TABLE "goods" ADD COLUMN     "good_image" TEXT;

-- AlterTable
ALTER TABLE "tags" ADD COLUMN     "tag_font_color" TEXT;

-- CreateTable
CREATE TABLE "good_tags" (
    "good_id" BIGINT NOT NULL,
    "tag_id" BIGINT NOT NULL,
    "created_at" TIMESTAMPTZ(6) NOT NULL DEFAULT CURRENT_TIMESTAMP,
    CONSTRAINT "good_tags_pkey" PRIMARY KEY ("good_id","tag_id")
);

-- CreateIndex
CREATE INDEX "good_tags_tag_id_idx" ON "good_tags"("tag_id");

-- AddForeignKey
ALTER TABLE "good_tags" ADD CONSTRAINT "good_tags_good_id_fkey" FOREIGN KEY ("good_id") REFERENCES "goods"("good_id") ON DELETE CASCADE ON UPDATE NO ACTION;
ALTER TABLE "good_tags" ADD CONSTRAINT "good_tags_tag_id_fkey" FOREIGN KEY ("tag_id") REFERENCES "tags"("tag_id") ON DELETE CASCADE ON UPDATE NO ACTION;
