ALTER TABLE "mobilepay_agreement" RENAME COLUMN "agreement_id" TO "mobilepay_id";--> statement-breakpoint
DROP INDEX "mobilepay_agreement_agreement_id_index";--> statement-breakpoint
ALTER TABLE "mobilepay_agreement" ALTER COLUMN "status" SET DATA TYPE varchar(15);--> statement-breakpoint
ALTER TABLE "mobilepay_agreement" ALTER COLUMN "status" SET DEFAULT 'PENDING';--> statement-breakpoint
ALTER TABLE "mobilepay_agreement" ADD COLUMN "user_id" uuid NOT NULL;--> statement-breakpoint
ALTER TABLE "mobilepay_agreement" ADD COLUMN "currency" varchar(3) NOT NULL;--> statement-breakpoint
ALTER TABLE "mobilepay_agreement" ADD CONSTRAINT "mobilepay_agreement_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE restrict ON UPDATE no action;--> statement-breakpoint
CREATE UNIQUE INDEX "mobilepay_agreement_mobilepay_id_index" ON "mobilepay_agreement" USING btree ("mobilepay_id");--> statement-breakpoint
ALTER TABLE "mobilepay_agreement" DROP COLUMN "seats";