3scale/porta

View on GitHub
db/migrate/20081205122455_add_parent_id_to_services.rb

Summary

Maintainability
A
0 mins
Test Coverage
class AddParentIdToServices < ActiveRecord::Migration
  def self.up
    add_column :services, :parent_id, :integer
    
    Service.all.each do |s|
      s.create_draft
      s.update_attribute(:updated_at, Time.now)
    end
  end

  def self.down
    remove_column :services, :parent_id
  end
end