-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add migration to fix data_store ids (#2452)
* Add migration to fix data_store ids * Adding PR suggestion
- Loading branch information
1 parent
7912cf2
commit 1485f41
Showing
2 changed files
with
10 additions
and
0 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
-- this is a one way migration |
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,9 @@ | ||
BEGIN; | ||
|
||
UPDATE data_stores | ||
SET id = 'current' | ||
WHERE id = (select id from data_stores where is_default='true' order by created_at limit 1); | ||
|
||
DELETE FROM data_stores WHERE id != 'current'; | ||
|
||
COMMIT; |