-- Run this on an EXISTING installation to add the new columns
-- Skip if doing a fresh install (install.sql already includes them)
ALTER TABLE `members`
  ADD COLUMN IF NOT EXISTS `ethnicity`     VARCHAR(80)  DEFAULT NULL AFTER `gender`,
  ADD COLUMN IF NOT EXISTS `religion`      VARCHAR(60)  DEFAULT NULL AFTER `ethnicity`,
  ADD COLUMN IF NOT EXISTS `sig_category`  ENUM('youth','women','pwd','minority','marginalized','general') DEFAULT NULL AFTER `religion`,
  ADD COLUMN IF NOT EXISTS `constituency`  VARCHAR(100) DEFAULT NULL AFTER `county`,
  ADD COLUMN IF NOT EXISTS `ward`          VARCHAR(100) DEFAULT NULL AFTER `constituency`;

-- Add resigned_at column (run if upgrading from a version before resign feature)
ALTER TABLE `members`
  ADD COLUMN IF NOT EXISTS `resigned_at` DATETIME DEFAULT NULL AFTER `registered_at`;
