Skip to content

Commit

Permalink
Merge pull request #513 from sanger/dpl-513-add-unique-index-to-labwa…
Browse files Browse the repository at this point in the history
…re-barcode

Add unique to labware_barcode column
  • Loading branch information
javidahmed64592 authored Jun 13, 2023
2 parents d323371 + 1de5f5b commit a10c7f4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion db/migrate/20230605152453_create_labware_location.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
class CreateLabwareLocation < ActiveRecord::Migration[7.0]
def change
create_table :labware_location do |t|
t.string :labware_barcode, unique: true, null: false, comment: 'Barcode on the stored labware'
t.string :labware_barcode, null: false, comment: 'Barcode on the stored labware'
t.string :location_barcode, null: false, comment: 'Barcode associated with storage location'
t.string :full_location_address, null: false, comment: 'Fully qualifed address of the nested location'
t.integer :coordinate_position, null: true, comment: 'Coordinate position of labware in storage location'
Expand All @@ -16,6 +16,7 @@ def change

t.timestamps

t.index :labware_barcode, unique: true
t.index :location_barcode
end
end
Expand Down
1 change: 1 addition & 0 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@
t.datetime "stored_at", null: false, comment: "Datetime the item was stored at this location"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["labware_barcode"], name: "index_labware_location_on_labware_barcode", unique: true
t.index ["location_barcode"], name: "index_labware_location_on_location_barcode"
end

Expand Down

0 comments on commit a10c7f4

Please sign in to comment.