Seed country and ethiopia_regions field options for dropdowns.

Add ISO-style country codes and Ethiopian regional states to initial and follow-up migrations.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Yared Yemane 2026-05-22 09:45:39 -07:00
parent a5acd00637
commit f7d4b5c3fb
5 changed files with 97 additions and 1 deletions

View File

@ -71,4 +71,44 @@ INSERT INTO field_options (field_key, code, label, display_order, status) VALUES
('favourite_topic', 'CULTURE', 'Culture', 4, 'ACTIVE'),
('favourite_topic', 'TRAVEL', 'Travel', 5, 'ACTIVE'),
('favourite_topic', 'ENTERTAINMENT', 'Entertainment', 6, 'ACTIVE'),
('favourite_topic', 'OTHER', 'Other', 99, 'ACTIVE');
('favourite_topic', 'OTHER', 'Other', 99, 'ACTIVE'),
('country', 'ET', 'Ethiopia', 1, 'ACTIVE'),
('country', 'ER', 'Eritrea', 2, 'ACTIVE'),
('country', 'DJ', 'Djibouti', 3, 'ACTIVE'),
('country', 'SO', 'Somalia', 4, 'ACTIVE'),
('country', 'KE', 'Kenya', 5, 'ACTIVE'),
('country', 'SD', 'Sudan', 6, 'ACTIVE'),
('country', 'SS', 'South Sudan', 7, 'ACTIVE'),
('country', 'UG', 'Uganda', 8, 'ACTIVE'),
('country', 'RW', 'Rwanda', 9, 'ACTIVE'),
('country', 'TZ', 'Tanzania', 10, 'ACTIVE'),
('country', 'EG', 'Egypt', 11, 'ACTIVE'),
('country', 'NG', 'Nigeria', 12, 'ACTIVE'),
('country', 'ZA', 'South Africa', 13, 'ACTIVE'),
('country', 'US', 'United States', 20, 'ACTIVE'),
('country', 'GB', 'United Kingdom', 21, 'ACTIVE'),
('country', 'CA', 'Canada', 22, 'ACTIVE'),
('country', 'DE', 'Germany', 23, 'ACTIVE'),
('country', 'FR', 'France', 24, 'ACTIVE'),
('country', 'IN', 'India', 25, 'ACTIVE'),
('country', 'CN', 'China', 26, 'ACTIVE'),
('country', 'SA', 'Saudi Arabia', 27, 'ACTIVE'),
('country', 'AE', 'United Arab Emirates', 28, 'ACTIVE'),
('country', 'OTHER', 'Other', 99, 'ACTIVE'),
('ethiopia_regions', 'ADDIS_ABABA', 'Addis Ababa', 1, 'ACTIVE'),
('ethiopia_regions', 'DIRE_DAWA', 'Dire Dawa', 2, 'ACTIVE'),
('ethiopia_regions', 'TIGRAY', 'Tigray', 3, 'ACTIVE'),
('ethiopia_regions', 'AFAR', 'Afar', 4, 'ACTIVE'),
('ethiopia_regions', 'AMHARA', 'Amhara', 5, 'ACTIVE'),
('ethiopia_regions', 'OROMIA', 'Oromia', 6, 'ACTIVE'),
('ethiopia_regions', 'SOMALI', 'Somali', 7, 'ACTIVE'),
('ethiopia_regions', 'BENISHANGUL_GUMUZ', 'Benishangul-Gumuz', 8, 'ACTIVE'),
('ethiopia_regions', 'GAMBELA', 'Gambela', 9, 'ACTIVE'),
('ethiopia_regions', 'HARARI', 'Harari', 10, 'ACTIVE'),
('ethiopia_regions', 'SIDAMA', 'Sidama', 11, 'ACTIVE'),
('ethiopia_regions', 'SOUTH_ETHIOPIA', 'South Ethiopia', 12, 'ACTIVE'),
('ethiopia_regions', 'SOUTH_WEST_ETHIOPIA', 'South West Ethiopia', 13, 'ACTIVE'),
('ethiopia_regions', 'CENTRAL_ETHIOPIA', 'Central Ethiopia', 14, 'ACTIVE'),
('ethiopia_regions', 'OTHER', 'Other', 99, 'ACTIVE');

View File

@ -0,0 +1,7 @@
DELETE FROM field_options
WHERE field_key = 'country'
AND code IN (
'ET', 'ER', 'DJ', 'SO', 'KE', 'SD', 'SS', 'UG', 'RW', 'TZ',
'EG', 'NG', 'ZA', 'US', 'GB', 'CA', 'DE', 'FR', 'IN', 'CN',
'SA', 'AE', 'OTHER'
);

View File

@ -0,0 +1,25 @@
INSERT INTO field_options (field_key, code, label, display_order, status) VALUES
('country', 'ET', 'Ethiopia', 1, 'ACTIVE'),
('country', 'ER', 'Eritrea', 2, 'ACTIVE'),
('country', 'DJ', 'Djibouti', 3, 'ACTIVE'),
('country', 'SO', 'Somalia', 4, 'ACTIVE'),
('country', 'KE', 'Kenya', 5, 'ACTIVE'),
('country', 'SD', 'Sudan', 6, 'ACTIVE'),
('country', 'SS', 'South Sudan', 7, 'ACTIVE'),
('country', 'UG', 'Uganda', 8, 'ACTIVE'),
('country', 'RW', 'Rwanda', 9, 'ACTIVE'),
('country', 'TZ', 'Tanzania', 10, 'ACTIVE'),
('country', 'EG', 'Egypt', 11, 'ACTIVE'),
('country', 'NG', 'Nigeria', 12, 'ACTIVE'),
('country', 'ZA', 'South Africa', 13, 'ACTIVE'),
('country', 'US', 'United States', 20, 'ACTIVE'),
('country', 'GB', 'United Kingdom', 21, 'ACTIVE'),
('country', 'CA', 'Canada', 22, 'ACTIVE'),
('country', 'DE', 'Germany', 23, 'ACTIVE'),
('country', 'FR', 'France', 24, 'ACTIVE'),
('country', 'IN', 'India', 25, 'ACTIVE'),
('country', 'CN', 'China', 26, 'ACTIVE'),
('country', 'SA', 'Saudi Arabia', 27, 'ACTIVE'),
('country', 'AE', 'United Arab Emirates', 28, 'ACTIVE'),
('country', 'OTHER', 'Other', 99, 'ACTIVE')
ON CONFLICT (field_key, code) DO NOTHING;

View File

@ -0,0 +1,7 @@
DELETE FROM field_options
WHERE field_key = 'ethiopia_regions'
AND code IN (
'ADDIS_ABABA', 'DIRE_DAWA', 'TIGRAY', 'AFAR', 'AMHARA', 'OROMIA', 'SOMALI',
'BENISHANGUL_GUMUZ', 'GAMBELA', 'HARARI', 'SIDAMA', 'SOUTH_ETHIOPIA',
'SOUTH_WEST_ETHIOPIA', 'CENTRAL_ETHIOPIA', 'OTHER'
);

View File

@ -0,0 +1,17 @@
INSERT INTO field_options (field_key, code, label, display_order, status) VALUES
('ethiopia_regions', 'ADDIS_ABABA', 'Addis Ababa', 1, 'ACTIVE'),
('ethiopia_regions', 'DIRE_DAWA', 'Dire Dawa', 2, 'ACTIVE'),
('ethiopia_regions', 'TIGRAY', 'Tigray', 3, 'ACTIVE'),
('ethiopia_regions', 'AFAR', 'Afar', 4, 'ACTIVE'),
('ethiopia_regions', 'AMHARA', 'Amhara', 5, 'ACTIVE'),
('ethiopia_regions', 'OROMIA', 'Oromia', 6, 'ACTIVE'),
('ethiopia_regions', 'SOMALI', 'Somali', 7, 'ACTIVE'),
('ethiopia_regions', 'BENISHANGUL_GUMUZ', 'Benishangul-Gumuz', 8, 'ACTIVE'),
('ethiopia_regions', 'GAMBELA', 'Gambela', 9, 'ACTIVE'),
('ethiopia_regions', 'HARARI', 'Harari', 10, 'ACTIVE'),
('ethiopia_regions', 'SIDAMA', 'Sidama', 11, 'ACTIVE'),
('ethiopia_regions', 'SOUTH_ETHIOPIA', 'South Ethiopia', 12, 'ACTIVE'),
('ethiopia_regions', 'SOUTH_WEST_ETHIOPIA', 'South West Ethiopia', 13, 'ACTIVE'),
('ethiopia_regions', 'CENTRAL_ETHIOPIA', 'Central Ethiopia', 14, 'ACTIVE'),
('ethiopia_regions', 'OTHER', 'Other', 99, 'ACTIVE')
ON CONFLICT (field_key, code) DO NOTHING;