Skip to content

Instantly share code, notes, and snippets.

@bronson
Created January 13, 2016 00:19
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 bronson/6dd82e44797de069ae3d to your computer and use it in GitHub Desktop.
Save bronson/6dd82e44797de069ae3d to your computer and use it in GitHub Desktop.
class DropProperties < ActiveRecord::Migration
class ChangeHistory < ActiveRecord::Base
# copied from real ChangeHistory model
scope :for_target, ->(target) { where(target_type: target.class.base_class.to_s, target_id: target.id) }
end
def change
drop_table :properties
ChangeHistory.for_target('Property').destroy
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment