Sha256: afe8b423f0339cca641f89075115488a03aaabc798f0934856f0a9ad50608cdb

Contents?: true

Size: 833 Bytes

Versions: 22

Compression:

Stored size: 833 Bytes

Contents

class CreateSpreePromotionCodeBatch < ActiveRecord::Migration[5.0]
  def change
    create_table :spree_promotion_code_batches do |t|
      t.references :promotion, null: false, index: true
      t.string :base_code, null: false
      t.integer :number_of_codes, null: false
      t.string :email
      t.string :error
      t.string :state, default: "pending"
      t.timestamps
    end

    add_foreign_key(
      :spree_promotion_code_batches,
      :spree_promotions,
      column: :promotion_id
    )

    add_column(
      :spree_promotion_codes,
      :promotion_code_batch_id,
      :integer
    )

    add_foreign_key(
      :spree_promotion_codes,
      :spree_promotion_code_batches,
      column: :promotion_code_batch_id
    )

    add_index(
      :spree_promotion_codes,
      :promotion_code_batch_id
    )
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
solidus_core-2.2.0.rc1 db/migrate/20161017102621_create_spree_promotion_code_batch.rb
solidus_core-2.2.0.beta1 db/migrate/20161017102621_create_spree_promotion_code_batch.rb