Sha256: f77b9e393db87e1d0c62ca5c83e3743ad32ab023b35b1b1fe724ca271b590649

Contents?: true

Size: 1.12 KB

Versions: 7

Compression:

Stored size: 1.12 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: ::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_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

7 entries across 7 versions & 1 rubygems

Version Path
unidom-inventory-0.7.3 db/migrate/20020901000000_create_unidom_serialized_inventory_items.rb
unidom-inventory-0.7.2 db/migrate/20020901000000_create_unidom_serialized_inventory_items.rb
unidom-inventory-0.7.1 db/migrate/20020901000000_create_unidom_serialized_inventory_items.rb
unidom-inventory-0.7 db/migrate/20020901000000_create_unidom_serialized_inventory_items.rb
unidom-inventory-0.6 db/migrate/20020901000000_create_unidom_serialized_inventory_items.rb
unidom-inventory-0.5 db/migrate/20020901000000_create_unidom_serialized_inventory_items.rb
unidom-inventory-0.4 db/migrate/20020901000000_create_unidom_serialized_inventory_items.rb