-- Add employee_count to tenants table.
-- Billing tiers are determined by company employee size, not platform user count.

ALTER TABLE tenants
  ADD COLUMN IF NOT EXISTS employee_count INT UNSIGNED NOT NULL DEFAULT 1
  AFTER industry;

-- Seed a representative employee count from the existing plan value
-- so each tenant stays on the same tier after this migration.
UPDATE tenants SET employee_count = 1   WHERE plan = 'starter';
UPDATE tenants SET employee_count = 25  WHERE plan = 'growth';
UPDATE tenants SET employee_count = 100 WHERE plan = 'business';
UPDATE tenants SET employee_count = 500 WHERE plan = 'enterprise';
