-- No-op on a fresh chain: 0000_legal_rhino's baseline snapshot was later
-- regenerated to already declare monthly_settlements.platform_commission
-- directly, so the source column this rename targets never exists here.
-- Guarded so the migration still runs correctly against any live database
-- that predates that baseline regeneration and still has the old column.
DO $$
BEGIN
  IF EXISTS (
    SELECT 1 FROM information_schema.columns
    WHERE table_name = 'monthly_settlements' AND column_name = 'hetzi_commission'
  ) THEN
    ALTER TABLE "monthly_settlements" RENAME COLUMN "hetzi_commission" TO "platform_commission";
  END IF;
END $$;
