Skip to content

Commit

Permalink
Merge pull request #511 from sanger/dpl-513-create-labware-locations-…
Browse files Browse the repository at this point in the history
…table

DPL-513 Create labware locations table
  • Loading branch information
javidahmed64592 authored Jun 8, 2023
2 parents 4cd7282 + 0c19434 commit d323371
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 1 deletion.
4 changes: 4 additions & 0 deletions app/models/labware_location.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# frozen_string_literal: true

class LabwareLocation < ApplicationRecord
end
22 changes: 22 additions & 0 deletions db/migrate/20230605152453_create_labware_location.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# frozen_string_literal: true

# Added a new table labware_location
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 :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'
t.integer :coordinate_row, null: true, comment: 'Coordinate row of labware in storage location'
t.integer :coordinate_column, null: true, comment: 'Coordinate column of labware in storage location'
t.string :lims_id, null: false, comment: 'ID of the storage system this data comes from'
t.string :stored_by, null: false, comment: 'Username of the person who placed the item there'
t.datetime :stored_at, null: false, comment: 'Datetime the item was stored at this location'

t.timestamps

t.index :location_barcode
end
end
end
17 changes: 16 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema[7.0].define(version: 2023_05_23_132939) do
ActiveRecord::Schema[7.0].define(version: 2023_06_05_152453) do
create_table "bmap_flowcell", primary_key: "id_bmap_flowcell_tmp", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8_unicode_ci", force: :cascade do |t|
t.datetime "last_updated", precision: nil, null: false, comment: "Timestamp of last update"
t.datetime "recorded_at", precision: nil, null: false, comment: "Timestamp of warehouse update"
Expand Down Expand Up @@ -107,6 +107,21 @@
t.index ["legacy_library_id"], name: "index_iseq_flowcell_legacy_library_id"
end

create_table "labware_location", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8_unicode_ci", force: :cascade do |t|
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", comment: "Coordinate position of labware in storage location"
t.integer "coordinate_row", comment: "Coordinate row of labware in storage location"
t.integer "coordinate_column", comment: "Coordinate column of labware in storage location"
t.string "lims_id", null: false, comment: "ID of the storage system this data comes from"
t.string "stored_by", null: false, comment: "Username of the person who placed the item there"
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 ["location_barcode"], name: "index_labware_location_on_location_barcode"
end

create_table "lighthouse_sample", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8_unicode_ci", force: :cascade do |t|
t.string "mongodb_id", comment: "Auto-generated id from MongoDB"
t.string "root_sample_id", null: false, comment: "Id for this sample provided by the Lighthouse lab"
Expand Down

0 comments on commit d323371

Please sign in to comment.