From 7c812b497dc23f9c1b0c38175525e2411cbf2484 Mon Sep 17 00:00:00 2001 From: Stephen <519327+stevieing@users.noreply.github.com> Date: Mon, 8 Jul 2024 09:15:14 +0100 Subject: [PATCH] Added insert size to aliquot table. --- db/migrate/20240708081135_add_insert_size_to_aliquots.rb | 9 +++++++++ db/schema.rb | 3 ++- spec/models/{aliquots_spec.rb => aliquot_spec.rb} | 3 ++- 3 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 db/migrate/20240708081135_add_insert_size_to_aliquots.rb rename spec/models/{aliquots_spec.rb => aliquot_spec.rb} (93%) diff --git a/db/migrate/20240708081135_add_insert_size_to_aliquots.rb b/db/migrate/20240708081135_add_insert_size_to_aliquots.rb new file mode 100644 index 00000000..990197cf --- /dev/null +++ b/db/migrate/20240708081135_add_insert_size_to_aliquots.rb @@ -0,0 +1,9 @@ +class AddInsertSizeToAliquots < ActiveRecord::Migration[7.0] + def up + add_column :aliquot, :insert_size, :integer, comment: 'The size of the insert in base pairs' + end + + def down + remove_column :aliquot, :insert_size, :integer + end +end diff --git a/db/schema.rb b/db/schema.rb index 6514896a..ee5ee844 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.0].define(version: 2024_06_14_135209) do +ActiveRecord::Schema[7.0].define(version: 2024_07_08_081135) do create_table "aliquot", charset: "utf8mb3", collation: "utf8mb3_unicode_ci", force: :cascade do |t| t.string "id_lims", null: false, comment: "The LIMS system that the aliquot was created in" t.string "lims_uuid", null: false, comment: "The UUID of the aliquot in the LIMS system" @@ -25,6 +25,7 @@ t.datetime "last_updated", null: false, comment: "The date and time that the aliquot was last updated" t.datetime "recorded_at", null: false, comment: "The date and time that the aliquot was recorded" t.datetime "created_at", null: false, comment: "The date and time that this record was created" + t.integer "insert_size", comment: "The size of the insert in base pairs" end create_table "bmap_flowcell", primary_key: "id_bmap_flowcell_tmp", id: :integer, charset: "utf8mb3", collation: "utf8mb3_unicode_ci", force: :cascade do |t| diff --git a/spec/models/aliquots_spec.rb b/spec/models/aliquot_spec.rb similarity index 93% rename from spec/models/aliquots_spec.rb rename to spec/models/aliquot_spec.rb index 19ff5b2c..297f44d2 100644 --- a/spec/models/aliquots_spec.rb +++ b/spec/models/aliquot_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe Aliquot do - context 'aliquots' do + context 'aliquot' do let(:example_lims) { 'example' } let(:json) do @@ -11,6 +11,7 @@ 'aliquot_type' => 'DNA', 'volume' => 5.43, 'concentration' => 2.34, + 'insert_size' => 100, 'lims_uuid' => '000000-0000-0000-0000-0000000002', 'source_type' => 'library', 'source_barcode' => 'PR-rna-00000001_H12',