diff --git a/db/migrations/20230822153000_streamline_annotation_key_prefix.rb b/db/migrations/20230822153000_streamline_annotation_key_prefix.rb index 50a32c1f623..2d7678743a4 100644 --- a/db/migrations/20230822153000_streamline_annotation_key_prefix.rb +++ b/db/migrations/20230822153000_streamline_annotation_key_prefix.rb @@ -1,32 +1,32 @@ -TABLE_BASE_NAMES = %w[ - app - build - buildpack - deployment - domain - droplet - isolation_segment - organization - package - process - revision - route_binding - route - service_binding - service_broker - service_broker_update_request - service_instance - service_key - service_offering - service_plan - space - stack - task - user -].freeze -annotation_tables = TABLE_BASE_NAMES.map { |tbn| "#{tbn}_annotations" }.freeze - Sequel.migration do + table_base_names = %w[ + app + build + buildpack + deployment + domain + droplet + isolation_segment + organization + package + process + revision + route_binding + route + service_binding + service_broker + service_broker_update_request + service_instance + service_key + service_offering + service_plan + space + stack + task + user + ].freeze + annotation_tables = table_base_names.map { |tbn| "#{tbn}_annotations" }.freeze + up do annotation_tables.each do |table| # Output all annotations with a forward Slash diff --git a/db/migrations/20230822173000_add_migration_views_for_annotations.rb b/db/migrations/20230822173000_add_migration_views_for_annotations.rb index bd37777446b..24d88d06f24 100644 --- a/db/migrations/20230822173000_add_migration_views_for_annotations.rb +++ b/db/migrations/20230822173000_add_migration_views_for_annotations.rb @@ -1,32 +1,32 @@ -TABLE_BASE_NAMES = %w[ - app - build - buildpack - deployment - domain - droplet - isolation_segment - organization - package - process - revision - route_binding - route - service_binding - service_broker - service_broker_update_request - service_instance - service_key - service_offering - service_plan - space - stack - task - user -].freeze -annotation_tables = TABLE_BASE_NAMES.map { |tbn| "#{tbn}_annotations" }.freeze - Sequel.migration do + table_base_names = %w[ + app + build + buildpack + deployment + domain + droplet + isolation_segment + organization + package + process + revision + route_binding + route + service_binding + service_broker + service_broker_update_request + service_instance + service_key + service_offering + service_plan + space + stack + task + user + ].freeze + annotation_tables = table_base_names.map { |tbn| "#{tbn}_annotations" }.freeze + up do annotation_tables.each do |table| create_view("#{table}_migration_view".to_sym, self[table.to_sym].select { [id, guid, created_at, updated_at, resource_guid, key_prefix, key.as(key_name), value] })