3 class AddMoreControlsToGpxFiles < ActiveRecord::Migration
5 create_enumeration :gpx_visibility_enum, %w(private public trackable identifiable)
6 add_column :gpx_files, :visibility, :gpx_visibility_enum, :default => "public", :null => false
7 Trace.where(:public => false).update_all(:visibility => "private")
8 add_index :gpx_files, [:visible, :visibility], :name => "gpx_files_visible_visibility_idx"
9 remove_index :gpx_files, :name => "gpx_files_visible_public_idx"
10 remove_column :gpx_files, :public
14 add_column :gpx_files, :public, :boolean, :default => true, :null => false
15 Trace.where(:visibility => "private").update_all(:public => false)
16 add_index :gpx_files, [:visible, :public], :name => "gpx_files_visible_public_idx"
17 remove_index :gpx_files, :name => "gpx_files_visible_visibility_idx"
18 remove_column :gpx_files, :visibility
19 drop_enumeration :gpx_visibility_enum