-- DropForeignKey
ALTER TABLE "tiered_payout_rule" DROP CONSTRAINT "tiered_payout_rule_userFinanceProfileId_fkey";

-- DropForeignKey
ALTER TABLE "tiered_payout_rule_data" DROP CONSTRAINT "tiered_payout_rule_data_tieredPayoutRuleId_fkey";

-- DropForeignKey
ALTER TABLE "tiered_payout_target_set" DROP CONSTRAINT "tiered_payout_target_set_tieredPayoutRuleId_fkey";

-- DropForeignKey
ALTER TABLE "user_finance_profile" DROP CONSTRAINT "user_finance_profile_userId_fkey";

-- AddForeignKey
ALTER TABLE "user_finance_profile" ADD CONSTRAINT "user_finance_profile_userId_fkey" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "tiered_payout_rule" ADD CONSTRAINT "tiered_payout_rule_userFinanceProfileId_fkey" FOREIGN KEY ("userFinanceProfileId") REFERENCES "user_finance_profile"("id") ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "tiered_payout_rule_data" ADD CONSTRAINT "tiered_payout_rule_data_tieredPayoutRuleId_fkey" FOREIGN KEY ("tieredPayoutRuleId") REFERENCES "tiered_payout_rule"("id") ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "tiered_payout_target_set" ADD CONSTRAINT "tiered_payout_target_set_tieredPayoutRuleId_fkey" FOREIGN KEY ("tieredPayoutRuleId") REFERENCES "tiered_payout_rule"("id") ON DELETE CASCADE ON UPDATE CASCADE;
