]> git.openstreetmap.org Git - rails.git/blobdiff - db/migrate/039_add_more_controls_to_gpx_files.rb
Merge remote-tracking branch 'upstream/pull/2718'
[rails.git] / db / migrate / 039_add_more_controls_to_gpx_files.rb
index c1e20ffd78afe4e10b0f7346c33f337cc5388b65..2c3fee5be92ab9cb20d8a6496e529134c6dfa611 100644 (file)
@@ -1,8 +1,12 @@
 require "migrate"
 
-class AddMoreControlsToGpxFiles < ActiveRecord::Migration
+class AddMoreControlsToGpxFiles < ActiveRecord::Migration[4.2]
+  class Trace < ApplicationRecord
+    self.table_name = "gpx_files"
+  end
+
   def self.up
-    create_enumeration :gpx_visibility_enum, %w(private public trackable identifiable)
+    create_enumeration :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"