X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/effb1b7f4170bb7244c4dfffcbe6134fe00e2bc4..4bca24a7beb4a78cecfeaa775d41662497f9930f:/db/migrate/039_add_more_controls_to_gpx_files.rb diff --git a/db/migrate/039_add_more_controls_to_gpx_files.rb b/db/migrate/039_add_more_controls_to_gpx_files.rb index 945a7021d..9f6d62148 100644 --- a/db/migrate/039_add_more_controls_to_gpx_files.rb +++ b/db/migrate/039_add_more_controls_to_gpx_files.rb @@ -1,8 +1,10 @@ -require "migrate" +class AddMoreControlsToGpxFiles < ActiveRecord::Migration[4.2] + class Trace < ApplicationRecord + self.table_name = "gpx_files" + end -class AddMoreControlsToGpxFiles < ActiveRecord::Migration[5.0] def self.up - create_enumeration :gpx_visibility_enum, %w[private public trackable identifiable] + create_enum :gpx_visibility_enum, %w[private public trackable identifiable] add_column :gpx_files, :visibility, :gpx_visibility_enum, :default => "public", :null => false Trace.where(:public => false).update_all(:visibility => "private") add_index :gpx_files, [:visible, :visibility], :name => "gpx_files_visible_visibility_idx"