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
This commit is contained in:
David Taylor 2019-08-07 16:09:42 +01:00
parent e49eb3bd9f
commit 550d0bdee1
1 changed files with 1 additions and 0 deletions

View File

@ -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