Sha256: 93503156972f52b24275cf5c4ba24dd7fa80c9cddd73ac36ea9af93f0f28d5e9

Contents?: true

Size: 1.05 KB

Versions: 10

Compression:

Stored size: 1.05 KB

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.references :lot,    type: :uuid, null: true

      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
    add_index :unidom_grouped_inventory_items, :lot_id

  end

end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
unidom-inventory-0.8 db/migrate/20020902000000_create_unidom_grouped_inventory_items.rb
unidom-inventory-0.7.5 db/migrate/20020902000000_create_unidom_grouped_inventory_items.rb
unidom-inventory-0.7.4 db/migrate/20020902000000_create_unidom_grouped_inventory_items.rb
unidom-inventory-0.7.3 db/migrate/20020902000000_create_unidom_grouped_inventory_items.rb
unidom-inventory-0.7.2 db/migrate/20020902000000_create_unidom_grouped_inventory_items.rb
unidom-inventory-0.7.1 db/migrate/20020902000000_create_unidom_grouped_inventory_items.rb
unidom-inventory-0.7 db/migrate/20020902000000_create_unidom_grouped_inventory_items.rb
unidom-inventory-0.6 db/migrate/20020902000000_create_unidom_grouped_inventory_items.rb
unidom-inventory-0.5 db/migrate/20020902000000_create_unidom_grouped_inventory_items.rb
unidom-inventory-0.4 db/migrate/20020902000000_create_unidom_grouped_inventory_items.rb