<commit_before>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
<commit_msg>1, Improve the Grouped Inventory Item migration for the #quantity column.<commit_after>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: 12, scale: 2

      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

{'fraction_non_alphanumeric': 0.11273209549071618, 'fraction_numerical': 0.018125552608311227, 'mean_word_length': 3.1295620437956204, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6743790', 'n_tokens_mistral': 809, 'n_tokens_neox': 749, 'n_words': 202}