File: 20170309214320_add_project_default_assigned_to_id.rb

package info (click to toggle)
redmine 6.0.6%2Bds-5
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 20,104 kB
  • sloc: ruby: 116,318; javascript: 12,885; sh: 460; perl: 303; python: 166; makefile: 30
file content (13 lines) | stat: -rw-r--r-- 474 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
class AddProjectDefaultAssignedToId < ActiveRecord::Migration[4.2]
  def up
    add_column :projects, :default_assigned_to_id, :integer, :default => nil
    # Try to copy existing settings from the plugin if redmine_default_assign plugin was used
    if column_exists?(:projects, :default_assignee_id, :integer)
      Project.update_all('default_assigned_to_id = default_assignee_id')
    end
  end

  def down
    remove_column :projects, :default_assigned_to_id
  end
end