mirror of
https://github.com/redmine/redmine.git
synced 2025-10-26 07:46:17 +01:00
git-svn-id: http://svn.redmine.org/redmine/trunk@17997 e93f8b46-1217-0410-a6f0-8f06a7374b81
14 lines
451 B
Ruby
14 lines
451 B
Ruby
class AddQueriesVisibility < ActiveRecord::Migration[4.2]
|
|
def up
|
|
add_column :queries, :visibility, :integer, :default => 0
|
|
Query.where(:is_public => true).update_all(:visibility => 2)
|
|
remove_column :queries, :is_public
|
|
end
|
|
|
|
def down
|
|
add_column :queries, :is_public, :boolean, :default => true, :null => false
|
|
Query.where('visibility <> ?', 2).update_all(:is_public => false)
|
|
remove_column :queries, :visibility
|
|
end
|
|
end
|