20141122124142_add_wiki_redirects_redirects_to_wiki_id.rb 383 Bytes
Newer Older
1
class AddWikiRedirectsRedirectsToWikiId < ActiveRecord::Migration[4.2]
2 3 4 5 6 7 8 9 10 11
  def self.up
    add_column :wiki_redirects, :redirects_to_wiki_id, :integer
    WikiRedirect.update_all "redirects_to_wiki_id = wiki_id"
    change_column :wiki_redirects, :redirects_to_wiki_id, :integer, :null => false
  end

  def self.down
    remove_column :wiki_redirects, :redirects_to_wiki_id
  end
end