Sha256: fc3455625d42da88232f8e1a97c1a337f2f95e153f1ebc38a90a3ee64d2d26cd

Contents?: true

Size: 939 Bytes

Versions: 10

Compression:

Stored size: 939 Bytes

Contents

# frozen_string_literal: true

# This migration comes from spree (originally 20161017102621)
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 precision: 6
    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

10 entries across 10 versions & 2 rubygems

Version Path
solidus_prototypes-1.6.0 spec/dummy/db/migrate/20231107091957_create_spree_promotion_code_batch.spree.rb
solidus_prototypes-1.5.1 spec/dummy/db/migrate/20231107091957_create_spree_promotion_code_batch.spree.rb
solidus_prototypes-1.5.0 spec/dummy/db/migrate/20231107091957_create_spree_promotion_code_batch.spree.rb
solidus_prototypes-1.4.0 spec/dummy/db/migrate/20231107091957_create_spree_promotion_code_batch.spree.rb
solidus_prototypes-1.3.0 spec/dummy/db/migrate/20230326093415_create_spree_promotion_code_batch.spree.rb
solidus_reports-1.2.0 spec/dummy/db/migrate/20230326095723_create_spree_promotion_code_batch.spree.rb
solidus_prototypes-1.2.0 spec/dummy/db/migrate/20221122203141_create_spree_promotion_code_batch.spree.rb
solidus_prototypes-1.1.1 spec/dummy/db/migrate/20221014070456_create_spree_promotion_code_batch.spree.rb
solidus_reports-1.1.0 spec/dummy/db/migrate/20221012211947_create_spree_promotion_code_batch.spree.rb
solidus_prototypes-1.1.0 spec/dummy/db/migrate/20221012201055_create_spree_promotion_code_batch.spree.rb