class CreatePromotionRuleStores < ActiveRecord::Migration[5.1]
  def change
    create_table :spree_promotion_rules_stores do |t|
      t.references :store, foreign_key: { to_table: "spree_stores" }
      t.references :promotion_rule, foreign_key: { to_table: "spree_promotion_rules" }

      t.timestamps
    end
  end
end

class CreatePromotionRuleStores < ActiveRecord::Migration[5.1]
  def change
    create_table :spree_promotion_rules_stores do |t|
      t.references :store, null: false
      t.references :promotion_rule, null: false

      t.timestamps
    end
  end
end

Remove foreign key from promotion_rules_stores
Remove foreign key from promotion_rules_stores

Similar to the issue with store_shipping_methods, this uses a different
type for the primary key than the reference, which is invalid and causes
an error under MySQL.
