@@ -1,17 +1,17 | |||
|
1 | 1 | class AddIssuesNestedSetsColumns < ActiveRecord::Migration |
|
2 | 2 | def self.up |
|
3 | 3 | add_column :issues, :parent_id, :integer, :default => nil |
|
4 | 4 | add_column :issues, :root_id, :integer, :default => nil |
|
5 | 5 | add_column :issues, :lft, :integer, :default => nil |
|
6 | 6 | add_column :issues, :rgt, :integer, :default => nil |
|
7 | ||
|
7 | ||
|
8 | 8 | Issue.update_all("parent_id = NULL, root_id = id, lft = 1, rgt = 2") |
|
9 | 9 | end |
|
10 | 10 | |
|
11 | 11 | def self.down |
|
12 | 12 | remove_column :issues, :parent_id |
|
13 | 13 | remove_column :issues, :root_id |
|
14 | 14 | remove_column :issues, :lft |
|
15 | 15 | remove_column :issues, :rgt |
|
16 | 16 | end |
|
17 | 17 | end |
General Comments 0
You need to be logged in to leave comments.
Login now