Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
class BackfillEmailPredictionMissingForUsers < ActiveRecord::Migration[6.1]
def up
execute <<~SQL
UPDATE users
Comment thread
dmbf29 marked this conversation as resolved.
SET notifications = jsonb_set(
jsonb_set(
COALESCE(notifications, '{}'::jsonb),
'{email}',
COALESCE(notifications->'email', '{}'::jsonb)
),
'{email,prediction_missing}',
'true'::jsonb
)
Comment thread
dmbf29 marked this conversation as resolved.
WHERE notifications IS NULL
OR notifications->'email'->>'prediction_missing' IS NULL
SQL
end

def down
raise ActiveRecord::IrreversibleMigration
end
end
2 changes: 1 addition & 1 deletion db/schema.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.