Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop to master #547

Merged
merged 20 commits into from
Sep 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.17.1
1.17.3
11 changes: 11 additions & 0 deletions db/migrate/20230802153621_add_priority_level_to_sample.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# frozen_string_literal: true

# Adding priority_level e.g. Medium, High etc to receive this information
# in a sample message from TOL through traction qc_receptions endpoint
class AddPriorityLevelToSample < ActiveRecord::Migration[7.0]
def change
change_table :sample, bulk: true do |t|
t.string :priority_level, comment: 'Priority level e.g. Medium, High etc'
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# frozen_string_literal: true

# Add index on sample id for long read qc results to be able to join with samples
class AddIndexLongReadQcResultsSampleId < ActiveRecord::Migration[7.0]
def change
add_index :long_read_qc_result, :sample_id, unique: false
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# frozen_string_literal: true

# Index to query long_read_qc_results using assay_type_key
class AddIndexLongReadQcResultsAssayTypeKey < ActiveRecord::Migration[7.0]
def change
add_index :long_read_qc_result, :assay_type_key, unique: false
end
end
35 changes: 19 additions & 16 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema[7.0].define(version: 2023_07_04_101316) 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|
ActiveRecord::Schema[7.0].define(version: 2023_08_21_100520) do
create_table "bmap_flowcell", primary_key: "id_bmap_flowcell_tmp", id: :integer, charset: "utf8mb3", collation: "utf8mb3_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"
t.integer "id_sample_tmp", null: false, comment: "Sample id, see \"sample.id_sample_tmp\"", unsigned: true
Expand All @@ -31,7 +31,7 @@
t.index ["id_study_tmp"], name: "fk_bmap_flowcell_to_study"
end

create_table "flgen_plate", primary_key: "id_flgen_plate_tmp", id: { type: :integer, unsigned: true }, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8_unicode_ci", force: :cascade do |t|
create_table "flgen_plate", primary_key: "id_flgen_plate_tmp", id: { type: :integer, unsigned: true }, charset: "utf8mb3", collation: "utf8mb3_unicode_ci", force: :cascade do |t|
t.integer "id_sample_tmp", null: false, comment: "Sample id, see \"sample.id_sample_tmp\"", unsigned: true
t.integer "id_study_tmp", null: false, comment: "Study id, see \"study.id_study_tmp\"", unsigned: true
t.string "cost_code", limit: 20, null: false, comment: "Valid WTSI cost code"
Expand All @@ -52,7 +52,7 @@
t.index ["id_study_tmp"], name: "flgen_plate_study_fk"
end

create_table "iseq_flowcell", primary_key: "id_iseq_flowcell_tmp", id: { type: :integer, unsigned: true }, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8_unicode_ci", force: :cascade do |t|
create_table "iseq_flowcell", primary_key: "id_iseq_flowcell_tmp", id: { type: :integer, unsigned: true }, charset: "utf8mb3", collation: "utf8mb3_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"
t.integer "id_sample_tmp", null: false, comment: "Sample id, see \"sample.id_sample_tmp\"", unsigned: true
Expand Down Expand Up @@ -107,7 +107,7 @@
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|
create_table "labware_location", id: :integer, charset: "utf8mb3", collation: "utf8mb3_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"
Expand All @@ -123,7 +123,7 @@
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|
create_table "lighthouse_sample", id: :integer, charset: "utf8mb3", collation: "utf8mb3_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"
t.string "cog_uk_id", null: false, comment: "Consortium-wide id, generated by Sanger on import to LIMS"
Expand Down Expand Up @@ -172,7 +172,7 @@
t.index ["root_sample_id", "rna_id", "result"], name: "index_lighthouse_sample_on_root_sample_id_and_rna_id_and_result", unique: true
end

create_table "long_read_qc_result", primary_key: "id_long_read_qc_result_tmp", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb3", force: :cascade do |t|
create_table "long_read_qc_result", primary_key: "id_long_read_qc_result_tmp", charset: "utf8mb3", collation: "utf8mb3_unicode_ci", force: :cascade do |t|
t.string "labware_barcode", null: false, comment: "Barcode of the labware that was the source for the QC tests."
t.string "sample_id", null: false, comment: "External identifier for the sample(s)."
t.string "assay_type", null: false, comment: "Type of the QC test."
Expand All @@ -186,9 +186,11 @@
t.datetime "recorded_at", precision: nil, comment: "Timestamp of the latest warehouse update."
t.string "qc_status", comment: "Status of the QC decision eg pass, fail etc"
t.string "qc_status_decision_by", comment: "Who made the QC status decision eg ToL, Long Read"
t.index ["assay_type_key"], name: "index_long_read_qc_result_on_assay_type_key"
t.index ["sample_id"], name: "index_long_read_qc_result_on_sample_id"
end

create_table "oseq_flowcell", primary_key: "id_oseq_flowcell_tmp", id: { type: :integer, unsigned: true }, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8_unicode_ci", force: :cascade do |t|
create_table "oseq_flowcell", primary_key: "id_oseq_flowcell_tmp", id: { type: :integer, unsigned: true }, charset: "utf8mb3", collation: "utf8mb3_unicode_ci", force: :cascade do |t|
t.string "id_flowcell_lims", null: false, comment: "LIMs-specific flowcell id"
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 @@ -218,7 +220,7 @@
t.index ["id_study_tmp"], name: "fk_oseq_flowcell_to_study"
end

create_table "pac_bio_run", primary_key: "id_pac_bio_tmp", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8_unicode_ci", force: :cascade do |t|
create_table "pac_bio_run", primary_key: "id_pac_bio_tmp", id: :integer, charset: "utf8mb3", collation: "utf8mb3_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"
t.integer "id_sample_tmp", null: false, comment: "Sample id, see \"sample.id_sample_tmp\"", unsigned: true
Expand Down Expand Up @@ -255,14 +257,14 @@
t.index ["id_study_tmp"], name: "fk_pac_bio_run_to_study"
end

create_table "psd_sample_compounds_components", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb3", comment: "A join table owned by PSD to associate compound samples with their component samples.", force: :cascade do |t|
create_table "psd_sample_compounds_components", charset: "utf8mb3", comment: "A join table owned by PSD to associate compound samples with their component samples.", force: :cascade do |t|
t.integer "compound_id_sample_tmp", null: false, comment: "The warehouse ID of the compound sample in the association."
t.integer "component_id_sample_tmp", null: false, comment: "The warehouse ID of the component sample in the association."
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."
end

create_table "qc_result", primary_key: "id_qc_result_tmp", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8_unicode_ci", force: :cascade do |t|
create_table "qc_result", primary_key: "id_qc_result_tmp", id: :integer, charset: "utf8mb3", collation: "utf8mb3_unicode_ci", force: :cascade do |t|
t.integer "id_sample_tmp", null: false, unsigned: true
t.string "id_qc_result_lims", limit: 20, null: false, comment: "LIMS-specific qc_result identifier"
t.string "id_lims", limit: 10, null: false, comment: "LIMS system identifier (e.g. SEQUENCESCAPE)"
Expand All @@ -282,7 +284,7 @@
t.index ["id_sample_tmp"], name: "fk_qc_result_to_sample"
end

create_table "sample", primary_key: "id_sample_tmp", id: { type: :integer, unsigned: true }, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8_unicode_ci", force: :cascade do |t|
create_table "sample", primary_key: "id_sample_tmp", id: { type: :integer, unsigned: true }, charset: "utf8mb3", collation: "utf8mb3_unicode_ci", force: :cascade do |t|
t.string "id_lims", limit: 10, null: false, comment: "LIM system identifier, e.g. CLARITY-GCLP, SEQSCAPE"
t.string "uuid_sample_lims", limit: 36, comment: "LIMS-specific sample uuid"
t.string "id_sample_lims", limit: 20, null: false, comment: "LIMS-specific sample identifier"
Expand Down Expand Up @@ -345,6 +347,7 @@
t.string "customer_measured_volume"
t.string "gc_content"
t.string "dna_source"
t.string "priority_level", comment: "Priority level eg Medium, High etc"
t.index ["accession_number"], name: "sample_accession_number_index"
t.index ["id_sample_lims", "id_lims"], name: "index_sample_on_id_sample_lims_and_id_lims", unique: true
t.index ["name"], name: "sample_name_index"
Expand All @@ -353,7 +356,7 @@
t.index ["uuid_sample_lims"], name: "sample_uuid_sample_lims_index", unique: true
end

create_table "samples_extraction_activity", primary_key: "id_activity_tmp", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8_unicode_ci", force: :cascade do |t|
create_table "samples_extraction_activity", primary_key: "id_activity_tmp", id: :integer, charset: "utf8mb3", collation: "utf8mb3_unicode_ci", force: :cascade do |t|
t.string "id_activity_lims", null: false, comment: "LIMs-specific activity id"
t.integer "id_sample_tmp", null: false, comment: "Sample id, see \"sample.id_sample_tmp\"", unsigned: true
t.string "activity_type", null: false, comment: "The type of the activity performed"
Expand All @@ -372,7 +375,7 @@
t.index ["id_sample_tmp"], name: "fk_rails_bbdd0468f0"
end

create_table "stock_resource", primary_key: "id_stock_resource_tmp", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8_unicode_ci", force: :cascade do |t|
create_table "stock_resource", primary_key: "id_stock_resource_tmp", id: :integer, charset: "utf8mb3", collation: "utf8mb3_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"
t.datetime "created", precision: nil, null: false, comment: "Timestamp of initial registration of stock in LIMS"
Expand All @@ -398,7 +401,7 @@
t.index ["id_study_tmp"], name: "fk_stock_resource_to_study"
end

create_table "study", primary_key: "id_study_tmp", id: { type: :integer, unsigned: true }, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8_unicode_ci", force: :cascade do |t|
create_table "study", primary_key: "id_study_tmp", id: { type: :integer, unsigned: true }, charset: "utf8mb3", collation: "utf8mb3_unicode_ci", force: :cascade do |t|
t.string "id_lims", limit: 10, null: false, comment: "LIM system identifier, e.g. GCLP-CLARITY, SEQSCAPE"
t.string "uuid_study_lims", limit: 36, comment: "LIMS-specific study uuid"
t.string "id_study_lims", limit: 20, null: false, comment: "LIMS-specific study identifier"
Expand Down Expand Up @@ -444,7 +447,7 @@
t.index ["uuid_study_lims"], name: "study_uuid_study_lims_index", unique: true
end

create_table "study_users", primary_key: "id_study_users_tmp", id: { type: :integer, unsigned: true }, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8_unicode_ci", force: :cascade do |t|
create_table "study_users", primary_key: "id_study_users_tmp", id: { type: :integer, unsigned: true }, charset: "utf8mb3", collation: "utf8mb3_unicode_ci", force: :cascade do |t|
t.integer "id_study_tmp", null: false, comment: "Study id, see \"study.id_study_tmp\"", unsigned: true
t.datetime "last_updated", precision: nil, null: false, comment: "Timestamp of last update"
t.string "role"
Expand Down
Loading