-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdatabase-rollback-custom-domains.sql
More file actions
49 lines (42 loc) · 1.52 KB
/
database-rollback-custom-domains.sql
File metadata and controls
49 lines (42 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
-- ============================================================
-- Rollback Custom Email Domain Fields
-- ============================================================
-- This removes the custom domain fields that were incorrectly added
-- and keeps only the HR Portal API fields
-- ============================================================
-- Remove custom email domain fields (these are not needed for HR Portal API)
ALTER TABLE user_profiles
DROP COLUMN IF EXISTS custom_email_domain,
DROP COLUMN IF EXISTS custom_email_verified,
DROP COLUMN IF EXISTS custom_sender_email;
-- Keep these fields for HR Portal API integration:
-- - subscription_tier (keep)
-- - hr_portal_api_enabled (keep)
-- - hr_portal_api_key (keep)
-- Remove the custom domain index
DROP INDEX IF EXISTS idx_user_profiles_subscription_tier;
-- Keep the API key index
-- idx_user_profiles_api_key (keep)
-- ============================================================
-- VERIFICATION
-- ============================================================
-- Verify custom domain columns were removed
SELECT column_name, data_type
FROM information_schema.columns
WHERE table_name = 'user_profiles'
AND column_name IN (
'custom_email_domain',
'custom_email_verified',
'custom_sender_email'
);
-- Should return no rows
-- Verify HR Portal API columns still exist
SELECT column_name, data_type
FROM information_schema.columns
WHERE table_name = 'user_profiles'
AND column_name IN (
'subscription_tier',
'hr_portal_api_enabled',
'hr_portal_api_key'
);
-- Should return 3 rows