Sha256: ade52ffb43ecc028b189554a656cae1c8a76a399b22b5d7d3b743b6dab0610b8

Contents?: true

Size: 695 Bytes

Versions: 5

Compression:

Stored size: 695 Bytes

Contents

class CreatePromotionBenefits < ActiveRecord::Migration[7.0]
  def change
    promotion_action_foreign_key = table_exists?(:spree_promotion_actions) ? { to_table: :spree_promotion_actions } : false

    create_table :solidus_promotions_benefits do |t|
      t.references :promotion, index: true, null: false, foreign_key: { to_table: :solidus_promotions_promotions }
      t.string :type
      t.text :preferences
      t.references :original_promotion_action, type: :integer, index: { name: :index_original_promotion_action_id }, foreign_key: promotion_action_foreign_key
      t.index [:id, :type], name: :index_solidus_promotions_benefits_on_id_and_type

      t.timestamps
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
solidus_promotions-4.5.1 db/migrate/20230703113625_create_promotion_benefits.rb
solidus_promotions-4.5.0 db/migrate/20230703113625_create_promotion_benefits.rb
solidus_promotions-4.4.2 db/migrate/20230703113625_create_promotion_benefits.rb
solidus_promotions-4.4.1 db/migrate/20230703113625_create_promotion_benefits.rb
solidus_promotions-4.4.0 db/migrate/20230703113625_create_promotion_benefits.rb