Sha256: 257e7f6c4724b827292516bcec36afed4dcdbdb26e4eec92fc8f5bc1af8d55f2

Contents?: true

Size: 503 Bytes

Versions: 6

Compression:

Stored size: 503 Bytes

Contents

class GroupsNestedSet < ActiveRecord::Migration
  def self.up
    add_column :groups, :parent_id, :integer
    add_column :groups, :root_group_id, :integer
    add_column :groups, :lft, :integer
    add_column :groups, :rgt, :integer
    
    Group.reset_column_information
    Group.rebuild!
    Group.all.each {|g| g.save }
  end

  def self.down
    remove_column :groups, :parent_id
    remove_column :groups, :root_group_id
    remove_column :groups, :lft
    remove_column :groups, :rgt
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
radiant-reader-extension-3.0.5 db/migrate/20110812111934_groups_nested_set.rb
radiant-reader-extension-3.0.4 db/migrate/20110812111934_groups_nested_set.rb
radiant-reader-extension-3.0.3 db/migrate/20110812111934_groups_nested_set.rb
radiant-reader-extension-3.0.2 db/migrate/20110812111934_groups_nested_set.rb
radiant-reader-extension-3.0.1 db/migrate/20110812111934_groups_nested_set.rb
radiant-reader-extension-3.0.0 db/migrate/20110812111934_groups_nested_set.rb