Sha256: 9ab8c768dcb802e28b515e50fc79db9cb839748d6f16bbd06d2cc73c4bc65f83

Contents?: true

Size: 350 Bytes

Versions: 4

Compression:

Stored size: 350 Bytes

Contents

class AddMasterIdToSite < ActiveRecord::Migration
  def self.up
    add_column :sites, :master_id, :integer
    # The id of the node without parent
    add_column :sites, :orphan_id, :integer
    execute "UPDATE sites SET orphan_id = root_id"
  end

  def self.down
    remove_column :sites, :master_id
    remove_column :sites, :orphan_id
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
zena-1.2.8 bricks/zena/zena/migrate/20130617164527_add_master_id_to_site.rb
zena-1.2.7 bricks/zena/zena/migrate/20130617164527_add_master_id_to_site.rb
zena-1.2.6 bricks/zena/zena/migrate/20130617164527_add_master_id_to_site.rb
zena-1.2.5 bricks/zena/zena/migrate/20130617164527_add_master_id_to_site.rb