Sha256: a871a4787be98025f55f2ede30e1d50ece6c6a5dd53acfed0ea5c03249fe612a

Contents?: true

Size: 1.14 KB

Versions: 1

Compression:

Stored size: 1.14 KB

Contents

class CreateUnidomSerializedInventoryItems < ActiveRecord::Migration

  def change

    create_table :unidom_serialized_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.string :serial_number, null: false, default: nil, limit: 200

      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_serialized_inventory_items, :stored_id
    add_index :unidom_serialized_inventory_items, :store_id
    add_index :unidom_serialized_inventory_items, :lot_id
    add_index :unidom_serialized_inventory_items, :serial_number

  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
unidom-inventory-2.0 db/migrate/20020901000000_create_unidom_serialized_inventory_items.rb