Sha256: 31e38b1613ded07fd3cceb076512c9e758b0b23eb3a2d27662aa63ceaafb618d

Contents?: true

Size: 967 Bytes

Versions: 3

Compression:

Stored size: 967 Bytes

Contents

class CreateUnidomGroupedInventoryItems < ActiveRecord::Migration

  def change

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

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

      t.decimal :quantity, null: false, default: 0.0, precision: 10, scale: 6

      t.column   :state, 'char(1)', null: false, default: 'C'
      t.datetime :opened_at,        null: false, default: ::Time.utc(1970)
      t.datetime :closed_at,        null: false, default: ::Time.utc(3000)
      t.boolean  :defunct,          null: false, default: false
      t.jsonb    :notation,         null: false, default: {}

      t.timestamps null: false

    end

    add_index :unidom_grouped_inventory_items, :stored_id
    add_index :unidom_grouped_inventory_items, :store_id

  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
unidom-inventory-0.3 db/migrate/20020902000000_create_unidom_grouped_inventory_items.rb
unidom-inventory-0.2 db/migrate/20020902000000_create_unidom_grouped_inventory_items.rb
unidom-inventory-0.1 db/migrate/20020902000000_create_unidom_grouped_inventory_items.rb