]> git.openstreetmap.org Git - rails.git/blobdiff - db/migrate/039_add_more_controls_to_gpx_files.rb
Bump coverallsapp/github-action from 2.2.0 to 2.2.1
[rails.git] / db / migrate / 039_add_more_controls_to_gpx_files.rb
index 5382324b3cc861e6ea00e7d71177b23aa35e8ad3..728b56989ee78d7c46c3372c3f0ec700c9d49916 100644 (file)
@@ -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
   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"