You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
361 B
17 lines
361 B
class WikiPageOrder < ActiveRecord::Migration
|
|
def self.up
|
|
add_column :wiki_pages, :position, :integer
|
|
add_column :wiki_page_versions, :position, :integer
|
|
Course.find(:all).each do |course|
|
|
course.wiki_pages.each_with_index do |wp, i|
|
|
wp.position = i+1
|
|
wp.save!
|
|
end
|
|
end
|
|
end
|
|
|
|
def self.down
|
|
remove_column :wiki_pages, :position
|
|
end
|
|
end
|