ef75d16bf4
Build & Auto-Repair / build (push) Has been cancelled
- 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)
11 lines
566 B
SQL
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;
|