-- Migration: Add missing club billing/settings columns used by the Club model.
-- This keeps upgraded installations in sync with the current Sequelize model.

ALTER TABLE clubs
  ADD COLUMN IF NOT EXISTS fee_rules JSON NULL
    COMMENT 'Manual contribution rules for common club member groups',
  ADD COLUMN IF NOT EXISTS outgoing_invoice_prefix VARCHAR(24) NOT NULL DEFAULT 'RE',
  ADD COLUMN IF NOT EXISTS outgoing_invoice_next_number INT NOT NULL DEFAULT 1,
  ADD COLUMN IF NOT EXISTS incoming_invoice_prefix VARCHAR(24) NOT NULL DEFAULT 'EI',
  ADD COLUMN IF NOT EXISTS incoming_invoice_next_number INT NOT NULL DEFAULT 1;