mirror of
https://github.com/dolphin-emu/redmine_issue_templates.git
synced 2025-02-18 16:39:43 +00:00
Add migration script for reordering. (IssueID: #962)
This commit is contained in:
parent
57989473f4
commit
480bfe4112
13
db/migrate/0004_add_position_to_issue_templates.rb
Normal file
13
db/migrate/0004_add_position_to_issue_templates.rb
Normal file
@ -0,0 +1,13 @@
|
||||
class AddPositionToIssueTemplates < ActiveRecord::Migration
|
||||
def self.up
|
||||
add_column :issue_templates, :position, :integer, :default => 1
|
||||
|
||||
IssueTemplate.reset_column_information
|
||||
issue_templates = IssueTemplate.find(:all)
|
||||
issue_templates.each_with_index {|t, i| t.update_attribute(:position, i+1)}
|
||||
end
|
||||
|
||||
def self.down
|
||||
remove_column :issue_templates, :position
|
||||
end
|
||||
end
|
Loading…
x
Reference in New Issue
Block a user