Skip to content

Instantly share code, notes, and snippets.

@ecordell
Created August 11, 2011 21:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ecordell/1140788 to your computer and use it in GitHub Desktop.
Save ecordell/1140788 to your computer and use it in GitHub Desktop.
class AddCitierViewsToLandscape < ActiveRecord::Migration
def self.up
remove_column :landscapes, :created_at
remove_column :landscapes, :updated_at
rename_column(:photos, :inheritance_column_name, :type)
create_citier_view(Landscape)
end
def self.down
add_column :landscapes, :updated_at, :timestamp
add_column :landscapes, :created_at, :timestamp
rename_column(:photos, :type, :inheritance_column_name)
drop_citier_view(Landscape)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment