[#2622] Change sort to proper JSONB

This commit is contained in:
Frederic Merizen 2018-09-20 17:02:28 +02:00
parent 68608307ad
commit 1419e9b73f
6 changed files with 6 additions and 9 deletions

View file

@ -2,7 +2,8 @@ namespace :'2018_09_20_procedure_presentation_jsonb' do
task run: :environment do
ProcedurePresentation.update_all(
<<~SQL
displayed_fields = ('[' || ARRAY_TO_STRING(old_displayed_fields, ',') || ']')::JSONB
displayed_fields = ('[' || ARRAY_TO_STRING(old_displayed_fields, ',') || ']')::JSONB,
sort = (sort #>> '{}')::jsonb
SQL
)
end