Sha256: 615ce65fe6e8fb4a40cb0db608f6102cbf0115b022133b24195f963cfb42ca70

Contents?: true

Size: 1011 Bytes

Versions: 2

Compression:

Stored size: 1011 Bytes

Contents

class CreateUnidomOrderAdjustments < ActiveRecord::Migration

  def change

    create_table :unidom_order_adjustments, id: :uuid do |t|

      t.references :adjusted, type: :uuid, null: false,
        polymorphic: { null: false, default: '', limit: 200 }

      t.column :adjustment_factor_code, 'char(4)', null: false, default: 'FRGT'
      t.column :calculation_code,       'char(4)', null: false, default: 'AMNT'

      t.decimal :amount, null: false, default: 0.0, precision: 12, scale: 2

      t.text :instruction
      t.text :description

      t.column   :state, 'char(1)', null: false, default: 'C'
      t.datetime :opened_at,        null: false, default: Unidom::Common::OPENED_AT
      t.datetime :closed_at,        null: false, default: Unidom::Common::CLOSED_AT
      t.boolean  :defunct,          null: false, default: false
      t.jsonb    :notation,         null: false, default: {}

      t.timestamps null: false

    end

    add_index :unidom_order_adjustments, :adjusted_id

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
unidom-order-2.0 db/migrate/20020603000000_create_unidom_order_adjustments.rb
unidom-order-1.5.9 db/migrate/20020603000000_create_unidom_order_adjustments.rb