-- Migrate from Mollie back to LemonSqueezy
-- Renames payment provider columns in registration and drinkkaart_topup tables,
-- and restores the lemonsqueezy_customer_id column on registration.

-- registration table:
--   mollie_payment_id -> lemonsqueezy_order_id
--   (re-add) lemonsqueezy_customer_id

ALTER TABLE registration RENAME COLUMN mollie_payment_id TO lemonsqueezy_order_id;
ALTER TABLE registration ADD COLUMN lemonsqueezy_customer_id text;

-- drinkkaart_topup table:
--   mollie_payment_id -> lemonsqueezy_order_id

ALTER TABLE drinkkaart_topup RENAME COLUMN mollie_payment_id TO lemonsqueezy_order_id;
