Merge pull request #245 from rposborne/db-upgrade

Add a DB migration to add params to schema.
This commit is contained in:
Jonas Grau 2017-06-02 10:16:24 +02:00 committed by GitHub
commit 513cd7d331
1 changed files with 12 additions and 0 deletions

View File

@ -0,0 +1,12 @@
class Version152UpdateImpressionsTable < ActiveRecord::Migration
def self.up
add_column :impressions, :params, :text
add_index :impressions, [:impressionable_type, :impressionable_id, :params], :name => "poly_params_request_index", :unique => false
end
def self.down
remove_index :impressions, [:impressionable_type, :impressionable_id, :params], :name => "poly_params_request_index"
remove_column :impressions, :params
end
end