mirror of
https://github.com/redmine/redmine.git
synced 2024-08-01 08:18:13 +02:00
16 lines
418 B
Ruby
16 lines
418 B
Ruby
![]() |
class AddTrackersDefaultStatusId < ActiveRecord::Migration
|
||
|
def up
|
||
|
add_column :trackers, :default_status_id, :integer
|
||
|
|
||
|
status_id = IssueStatus.where(:is_default => true).pluck(:id).first
|
||
|
status_id ||= IssueStatus.order(:position).pluck(:id).first
|
||
|
if status_id
|
||
|
Tracker.update_all :default_status_id => status_id
|
||
|
end
|
||
|
end
|
||
|
|
||
|
def down
|
||
|
remove_column :trackers, :default_status_id
|
||
|
end
|
||
|
end
|