mirror of
https://github.com/discourse/discourse.git
synced 2026-08-14 06:55:03 -05:00
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:
@@ -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
|
SELECT theme_settings.value::int, 'ThemeSetting', theme_settings.id, uploads.created_at, uploads.updated_at
|
||||||
FROM theme_settings
|
FROM theme_settings
|
||||||
JOIN uploads ON uploads.id = theme_settings.value::int
|
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
|
ON CONFLICT DO NOTHING
|
||||||
SQL
|
SQL
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user