  class AddExternalIdToAffiliateDistributions < ActiveRecord::Migration

    def self.up
      execute("ALTER TABLE affiliate_distributions ADD COLUMN external_id character varying(64)")
      execute("ALTER TABLE affiliate_distributions ADD CONSTRAINT affiliate_distributions_external_id_key UNIQUE (external_id)")
    end

    def self.down
      execute("ALTER TABLE affiliate_distributions DROP CONSTRAINT affiliate_distributions_external_id_key")
      execute("ALTER TABLE affiliate_distributions DROP COLUMN external_id")
    end
  end
