From 550d0bdee14d3189cf51f84789dfd283200b4e04 Mon Sep 17 00:00:00 2001 From: David Taylor Date: Wed, 7 Aug 2019 16:09:42 +0100 Subject: [PATCH] FIX: Ignore non-numeric values when migrating from old data format This fixes 'invalid input syntax for integer' errors when the old data is invalid --- db/migrate/20190724055909_move_to_managed_authenticator.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/db/migrate/20190724055909_move_to_managed_authenticator.rb b/db/migrate/20190724055909_move_to_managed_authenticator.rb index 6356bc1..09cc1d4 100644 --- a/db/migrate/20190724055909_move_to_managed_authenticator.rb +++ b/db/migrate/20190724055909_move_to_managed_authenticator.rb @@ -17,6 +17,7 @@ class MoveToManagedAuthenticator < ActiveRecord::Migration[5.2] CURRENT_TIMESTAMP FROM plugin_store_rows WHERE plugin_name = 'oauth2_basic' + AND value::json->>'user_id' ~ '^[0-9]+$' ON CONFLICT (provider_name, user_id) DO NOTHING SQL