-
Notifications
You must be signed in to change notification settings - Fork 428
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prepare domains backend to allow retries
Current logic for domain deletion first checks that the domain exists, then removes the domain, and then runs the remove_domain hook. But this is a problem, because if any of the hooks fails, then retrying the domain removal won’t work, because it will be stopped at the first check for domain existence. Here we instead mark the domain as "in progress for deletion", which will already disable it, and only finally delete it _after_ all hook handlers have run hopefully successfully.
- Loading branch information
1 parent
6c3819f
commit 3eea77f
Showing
12 changed files
with
123 additions
and
74 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
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
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
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
-- DOMAINS | ||
sp_rename 'domains_settings.enabled', 'status', 'COLUMN'; |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
-- DOMAINS | ||
ALTER TABLE domain_settings ALTER COLUMN enabled DROP DEFAULT; | ||
ALTER TABLE domain_settings CHANGE enabled status TINYINT NOT NULL; | ||
ALTER TABLE domain_settings ALTER COLUMN status SET DEFAULT 1; |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
-- DOMAINS | ||
ALTER TABLE domains_settings ALTER COLUMN enabled DROP DEFAULT; | ||
|
||
ALTER TABLE domains_settings | ||
ALTER COLUMN enabled TYPE SMALLINT USING CASE WHEN enabled THEN 1 ELSE 0 END; | ||
|
||
ALTER TABLE domains_settings | ||
RENAME enabled TO status; | ||
|
||
ALTER TABLE domains_settings ALTER COLUMN status SET DEFAULT 1; |
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
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
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
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
Oops, something went wrong.