FIX: Handle empty string in theme_settings for upload_references (#17047)
Follow up to 9db8f00b3d
,
the theme_settings.value field is not an integer and so
can be '', we need to account for this in the migration
otherwise we get this error:
> PG::InvalidTextRepresentation: ERROR: invalid input syntax for type integer: ""
This commit is contained in:
parent
946f8a65fd
commit
20f118c4c9
|
@ -7,7 +7,7 @@ class CopyThemeSettingsUploadsToUploadReferences < ActiveRecord::Migration[6.1]
|
|||
SELECT theme_settings.value::int, 'ThemeSetting', theme_settings.id, uploads.created_at, uploads.updated_at
|
||||
FROM theme_settings
|
||||
JOIN uploads ON uploads.id = theme_settings.value::int
|
||||
WHERE data_type = 6 AND theme_settings.value IS NOT NULL
|
||||
WHERE data_type = 6 AND theme_settings.value IS NOT NULL AND theme_settings.value != ''
|
||||
ON CONFLICT DO NOTHING
|
||||
SQL
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue