Files
Newbie_CRM/database/migrations/024_resource_planning.sql
T
Rene ef75d16bf4
Build & Auto-Repair / build (push) Has been cancelled
Add Resource Planning: team capacity, utilisation, workload overview
- Migration 024: adds capacity_hours column to users (default 40h/week)
- /api/resource-planning: aggregates hours from time_entries, open tasks,
  active projects per user with utilisation calculations
- /resource-planning page: overview stats cards, per-member capacity bars
  with colour-coded status (green=available, yellow=busy, orange=near
  capacity, red=overloaded)
- Sidebar: new Resources nav item (BarChart3 icon)
2026-07-01 13:12:48 +02:00

11 lines
566 B
SQL

-- ============================================================================
-- Resource Planning — Team capacity, utilisation rates, availability
-- ============================================================================
ALTER TABLE users ADD COLUMN IF NOT EXISTS capacity_hours DECIMAL(5,2) NOT NULL DEFAULT 40;
ALTER TABLE users ADD COLUMN IF NOT EXISTS avatar_url TEXT;
ALTER TABLE users ADD COLUMN IF NOT EXISTS password_encrypted TEXT;
-- Set default capacities for existing users
UPDATE users SET capacity_hours = 40 WHERE capacity_hours IS NULL;