Skip to content

Commit

Permalink
Add migration to fix data_store ids (#2452)
Browse files Browse the repository at this point in the history
* Add migration to fix data_store ids

* Adding PR suggestion
  • Loading branch information
danielbdias committed Apr 27, 2023
1 parent 7912cf2 commit 1485f41
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions server/migrations/25_update_data_stores_id.down.sql
@@ -0,0 +1 @@
-- this is a one way migration
9 changes: 9 additions & 0 deletions server/migrations/25_update_data_stores_id.up.sql
@@ -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;

0 comments on commit 1485f41

Please sign in to comment.