Merge branch '21703-collection-update-lock'
[arvados.git] / services / api / db / migrate / 20170704160233_yaml_to_json.rb
1 # Copyright (C) The Arvados Authors. All rights reserved.
2 #
3 # SPDX-License-Identifier: AGPL-3.0
4
5 require 'migrate_yaml_to_json'
6
7 class YamlToJson < ActiveRecord::Migration[4.2]
8   def up
9     [
10       ['collections', 'properties'],
11       ['containers', 'environment'],
12       ['containers', 'mounts'],
13       ['containers', 'runtime_constraints'],
14       ['containers', 'command'],
15       ['containers', 'scheduling_parameters'],
16       ['container_requests', 'properties'],
17       ['container_requests', 'environment'],
18       ['container_requests', 'mounts'],
19       ['container_requests', 'runtime_constraints'],
20       ['container_requests', 'command'],
21       ['container_requests', 'scheduling_parameters'],
22       ['humans', 'properties'],
23       ['job_tasks', 'parameters'],
24       ['links', 'properties'],
25       ['nodes', 'info'],
26       ['nodes', 'properties'],
27       ['pipeline_instances', 'components'],
28       ['pipeline_instances', 'properties'],
29       ['pipeline_instances', 'components_summary'],
30       ['pipeline_templates', 'components'],
31       ['specimens', 'properties'],
32       ['traits', 'properties'],
33       ['users', 'prefs'],
34     ].each do |table, column|
35       MigrateYAMLToJSON.migrate(table, column)
36     end
37   end
38
39   def down
40   end
41 end