From 82a2216ef243ba036eda55532dfa065945ac688a Mon Sep 17 00:00:00 2001 From: Sattvik Chakravarthy Date: Thu, 7 Sep 2023 12:16:30 +0530 Subject: [PATCH] fix: updated migration script --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e7b4fc83..d4281f39e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,10 +40,18 @@ ALTER TABLE all_auth_recipe_users ALTER TABLE all_auth_recipe_users ADD COLUMN is_linked_or_is_a_primary_user BOOLEAN NOT NULL DEFAULT FALSE; +ALTER TABLE all_auth_recipe_users + ADD COLUMN primary_or_recipe_user_time_joined BIGINT NOT NULL DEFAULT 0; + UPDATE all_auth_recipe_users SET primary_or_recipe_user_id = user_id WHERE primary_or_recipe_user_id = '0'; +UPDATE all_auth_recipe_users +SET primary_or_recipe_user_time_joined = time_joined +WHERE primary_or_recipe_user_time_joined = 0; + + ALTER TABLE all_auth_recipe_users ALTER primary_or_recipe_user_id DROP DEFAULT;