2018-09-20 17:05:58 +02:00
|
|
|
namespace :'2018_09_20_procedure_presentation_jsonb' do
|
|
|
|
task run: :environment do
|
|
|
|
ProcedurePresentation.update_all(
|
|
|
|
<<~SQL
|
2018-09-20 17:02:28 +02:00
|
|
|
displayed_fields = ('[' || ARRAY_TO_STRING(old_displayed_fields, ',') || ']')::JSONB,
|
2018-09-20 16:18:21 +02:00
|
|
|
sort = (sort #>> '{}')::jsonb,
|
|
|
|
filters = (filters #>> '{}')::jsonb
|
2018-09-20 17:05:58 +02:00
|
|
|
SQL
|
|
|
|
)
|
|
|
|
end
|
|
|
|
end
|