Sha256: 422a069e3414bc0138c98008175f8dcd79ac3d40d925d85a440c80f2239d8d51

Contents?: true

Size: 876 Bytes

Versions: 9

Compression:

Stored size: 876 Bytes

Contents

# frozen_string_literal: true

class CreatePromotionCodeBatches < ActiveRecord::Migration[7.0]
  def change
    create_table :friendly_promotion_code_batches do |t|
      t.references :promotion, null: false, index: true, foreign_key: {to_table: :friendly_promotions}
      t.string :base_code, null: false
      t.integer :number_of_codes, null: false
      t.string :join_characters, null: false, default: "_"
      t.string :email
      t.string :error
      t.string :state, default: "pending"
      t.timestamps precision: 6
    end

    add_column(
      :friendly_promotion_codes,
      :promotion_code_batch_id,
      :bigint
    )

    add_foreign_key(
      :friendly_promotion_codes,
      :friendly_promotion_code_batches,
      column: :promotion_code_batch_id
    )

    add_index(
      :friendly_promotion_codes,
      :promotion_code_batch_id
    )
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
solidus_friendly_promotions-1.9.3 db/migrate/20230704102656_create_promotion_code_batches.rb
solidus_friendly_promotions-1.9.2 db/migrate/20230704102656_create_promotion_code_batches.rb
solidus_friendly_promotions-1.9.1 db/migrate/20230704102656_create_promotion_code_batches.rb
solidus_friendly_promotions-1.9.0 db/migrate/20230704102656_create_promotion_code_batches.rb
solidus_friendly_promotions-1.0.0 db/migrate/20230704102656_create_promotion_code_batches.rb
solidus_friendly_promotions-1.0.0.rc.3 db/migrate/20230704102656_create_promotion_code_batches.rb
solidus_friendly_promotions-1.0.0.rc.2 db/migrate/20230704102656_create_promotion_code_batches.rb
solidus_friendly_promotions-1.0.0.rc.1 db/migrate/20230704102656_create_promotion_code_batches.rb
solidus_friendly_promotions-1.0.0.pre db/migrate/20230704102656_create_promotion_code_batches.rb