Changeset 0.8.6 (#49)

This commit is contained in:
2026-02-22 16:52:19 +00:00
parent 633421708f
commit 15be26c516
17 changed files with 870 additions and 152 deletions

View File

@@ -0,0 +1,16 @@
-- ==========================================
-- Migration 021: Team Providers
-- ==========================================
-- Adds team_id to api_configs, enabling teams to have their own
-- provider configs managed by team admins.
--
-- Provider hierarchy: global (user_id IS NULL, is_global=true)
-- → team (team_id IS NOT NULL)
-- → personal (user_id IS NOT NULL)
-- ==========================================
-- Add team_id FK to api_configs
ALTER TABLE api_configs ADD COLUMN IF NOT EXISTS team_id UUID REFERENCES teams(id) ON DELETE CASCADE;
CREATE INDEX IF NOT EXISTS idx_api_configs_team ON api_configs(team_id) WHERE team_id IS NOT NULL;
COMMENT ON COLUMN api_configs.team_id IS 'Team-scoped provider — managed by team admins, visible to team members';