ALTER TABLE "mobilepay_charge" RENAME COLUMN "provider_charge_id" TO "mobilepay_id";--> statement-breakpoint
ALTER TABLE "mobilepay_charge" DROP CONSTRAINT "mobilepay_charge_mobilepay_agreement_id_mobilepay_agreement_id_fk";
--> statement-breakpoint
DROP INDEX "mp_charge_provider_charge_id_uq";--> statement-breakpoint
ALTER TABLE "mobilepay_charge" ALTER COLUMN "agreement_id" SET DATA TYPE uuid USING agreement_id::uuid;--> statement-breakpoint
ALTER TABLE "mobilepay_charge" ADD CONSTRAINT "mobilepay_charge_agreement_id_mobilepay_agreement_id_fk" FOREIGN KEY ("agreement_id") REFERENCES "public"."mobilepay_agreement"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
CREATE UNIQUE INDEX "mobilepay_charge_mobilepay_id_index" ON "mobilepay_charge" USING btree ("mobilepay_id");--> statement-breakpoint
ALTER TABLE "mobilepay_charge" DROP COLUMN "mobilepay_agreement_id";