-
-
Notifications
You must be signed in to change notification settings - Fork 825
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24706 from seamuslee001/update_indian_states
[REF] Update Indian States as per ISO-3166-2
- Loading branch information
Showing
3 changed files
with
4,166 additions
and
4,119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,16 @@ | ||
{* file to handle db changes in 5.56.alpha1 during upgrade *} | ||
|
||
-- Add in missing indian states as per iso-3166-2 | ||
SELECT @indianCountryID := id FROM civicrm_country WHERE name = 'India' AND iso_code = 'IN'; | ||
INSERT INTO civicrm_state_province (country_id, abbreviation, name) VALUES | ||
(@indianCountryID, "LA", "Ladākh"), | ||
(@indianCountryID, "DH", "Dādra and Nagar Haveli and Damān and Diu"); | ||
|
||
SELECT @DHStateID := id from civicrm_state_province WHERE country_id = @indianCountryID AND abbreviation = 'DH'; | ||
|
||
UPDATE civicrm_address ca | ||
INNER JOIN civicrm_state_province csp ON csp.id = ca.state_province_id | ||
SET ca.state_province_id = @DHStateID | ||
WHERE csp.country_id = @indianCountryID AND csp.abbreviation IN ("DN", "DD"); | ||
|
||
UPDATE civicrm_state_province SET is_active = 0 WHERE country_id = @indianCountryID AND abbreviation IN ("DN", "DD"); |
Oops, something went wrong.