Sha256: 2d870446e1e60c2a4e1ea4f5885b36551095fffb8eab7802c915d54fae2b0cc3
Contents?: true
Size: 567 Bytes
Versions: 5
Compression:
Stored size: 567 Bytes
Contents
class MovePageToNestedSet < ActiveRecord::Migration def self.up # Add nested set columns add_column :pages, :lft, :integer add_column :pages, :rgt, :integer add_column :pages, :depth, :integer add_index :pages, :lft add_index :pages, :rgt add_index :pages, :depth # Rebuild the page table Page.rebuild! end def self.down remove_index :pages, :lft remove_index :pages, :rgt remove_index :pages, :depth remove_column :pages, :lft remove_column :pages, :rgt remove_column :pages, :depth end end
Version data entries
5 entries across 5 versions & 1 rubygems