Skip to content

Commit

Permalink
fix(medusa): Money amount detached migration
Browse files Browse the repository at this point in the history
  • Loading branch information
adrien2p committed Sep 15, 2023
1 parent 7d35723 commit e22da02
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class dropMoneyAmountConstraintsForPricingModule1692953518123
DROP INDEX IF EXISTS "idx_product_variant_money_amount_money_amount_id_unique";
DROP INDEX IF EXISTS "idx_product_variant_money_amount_variant_id";
ALTER TABLE "product_variant_money_amount" ADD COLUMN IF NOT EXISTS "variant_id";
ALTER TABLE "money_amount" ADD COLUMN IF NOT EXISTS "variant_id" text;
UPDATE "money_amount" SET "variant_id" = "product_variant_money_amount"."variant_id"
FROM "product_variant_money_amount"
Expand All @@ -44,6 +44,7 @@ export class dropMoneyAmountConstraintsForPricingModule1692953518123
DROP TABLE IF EXISTS "product_variant_money_amount";
CREATE INDEX IF NOT EXISTS idx_product_variant_money_amount_id ON money_amount (variant_id);
ALTER TABLE "money_amount" ADD CONSTRAINT "FK_17a06d728e4cfbc5bd2ddb70af0" FOREIGN KEY ("variant_id") REFERENCES "product_variant"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
`
)
}
Expand Down

0 comments on commit e22da02

Please sign in to comment.