-- Migration: Remove legacy provider system
-- Date: 2026-02-20
-- Context: Multi-practice system (practices + user_practices + practice_filter.php)
--          fully replaced the old provider system. This removes dead weight.

-- Drop FK constraints first
ALTER TABLE users DROP CONSTRAINT IF EXISTS fk_provider;
ALTER TABLE patients DROP CONSTRAINT IF EXISTS patients_provider_id_fkey;

-- Drop columns
ALTER TABLE users DROP COLUMN IF EXISTS provider_id;
ALTER TABLE patients DROP COLUMN IF EXISTS provider_id;

-- Drop providers table
DROP TABLE IF EXISTS providers;
