From 5000a6d8788b19f9aaac37f1ef53fb826bd66b07 Mon Sep 17 00:00:00 2001 From: Marina Gourtovaia Date: Mon, 23 Oct 2023 16:41:50 +0100 Subject: [PATCH 1/2] Updated DBIx classes from the prod database schema. Two types of changes: 1. due to a aserver upgrade tp MySQL v.8+ 2. due to database schema changes. --- .../Warehouse/Schema/Result/FlgenPlate.pm | 8 ++-- .../Schema/Result/GsuSampleUpload.pm | 40 ++++++++++++++----- .../Result/IseqExternalProductComponent.pm | 6 +-- .../Warehouse/Schema/Result/IseqFlowcell.pm | 10 ++--- .../Schema/Result/IseqHeronClimbStatus.pm | 7 ++-- .../Schema/Result/IseqProductAmpliconstat.pm | 6 +-- .../Schema/Result/IseqProductComponent.pm | 8 ++-- .../Schema/Result/IseqProductMetric.pm | 8 ++-- .../Warehouse/Schema/Result/IseqRunInfo.pm | 6 +-- .../Warehouse/Schema/Result/IseqRunStatus.pm | 6 +-- .../Schema/Result/PacBioProductMetric.pm | 8 ++-- .../Schema/Result/PacBioRunWellMetric.pm | 4 +- .../DNAP/Warehouse/Schema/Result/Sample.pm | 14 ++++++- .../DNAP/Warehouse/Schema/Result/StudyUser.pm | 6 +-- 14 files changed, 83 insertions(+), 54 deletions(-) diff --git a/lib/WTSI/DNAP/Warehouse/Schema/Result/FlgenPlate.pm b/lib/WTSI/DNAP/Warehouse/Schema/Result/FlgenPlate.pm index ad6f792..d53cc0d 100644 --- a/lib/WTSI/DNAP/Warehouse/Schema/Result/FlgenPlate.pm +++ b/lib/WTSI/DNAP/Warehouse/Schema/Result/FlgenPlate.pm @@ -252,7 +252,7 @@ __PACKAGE__->belongs_to( 'sample', 'WTSI::DNAP::Warehouse::Schema::Result::Sample', { id_sample_tmp => 'id_sample_tmp' }, - { is_deferrable => 1, on_delete => 'NO ACTION', on_update => 'NO ACTION' }, + { is_deferrable => 1, on_delete => 'RESTRICT', on_update => 'RESTRICT' }, ); =head2 study @@ -267,12 +267,12 @@ __PACKAGE__->belongs_to( 'study', 'WTSI::DNAP::Warehouse::Schema::Result::Study', { id_study_tmp => 'id_study_tmp' }, - { is_deferrable => 1, on_delete => 'NO ACTION', on_update => 'NO ACTION' }, + { is_deferrable => 1, on_delete => 'RESTRICT', on_update => 'RESTRICT' }, ); -# Created by DBIx::Class::Schema::Loader v0.07036 @ 2015-01-19 16:35:18 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Df/CLIOB+DW9/6zUgYLM6A +# Created by DBIx::Class::Schema::Loader v0.07051 @ 2023-10-23 16:35:44 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:lD09a55ctFBQGOiCkQis4Q our $VERSION = '0'; diff --git a/lib/WTSI/DNAP/Warehouse/Schema/Result/GsuSampleUpload.pm b/lib/WTSI/DNAP/Warehouse/Schema/Result/GsuSampleUpload.pm index 1c93c81..25ed59a 100644 --- a/lib/WTSI/DNAP/Warehouse/Schema/Result/GsuSampleUpload.pm +++ b/lib/WTSI/DNAP/Warehouse/Schema/Result/GsuSampleUpload.pm @@ -78,7 +78,7 @@ Location of data file data_type: 'integer' extra: {unsigned => 1} is_foreign_key: 1 - is_nullable: 0 + is_nullable: 1 Study for this item @@ -87,14 +87,14 @@ Study for this item data_type: 'integer' extra: {unsigned => 1} is_foreign_key: 1 - is_nullable: 0 + is_nullable: 1 Sample info for this item =head2 library_name data_type: 'varchar' - is_nullable: 0 + is_nullable: 1 size: 40 Supplier library name @@ -131,6 +131,14 @@ Lab supplying the data ENA run accession, populated on ENA submission +=head2 ena_upload + + data_type: 'tinyint' + default_value: 0 + is_nullable: 0 + +Identifies if the sample is eligible for ENA upload + =cut __PACKAGE__->add_columns( @@ -162,17 +170,17 @@ __PACKAGE__->add_columns( data_type => 'integer', extra => { unsigned => 1 }, is_foreign_key => 1, - is_nullable => 0, + is_nullable => 1, }, 'id_sample_tmp', { data_type => 'integer', extra => { unsigned => 1 }, is_foreign_key => 1, - is_nullable => 0, + is_nullable => 1, }, 'library_name', - { data_type => 'varchar', is_nullable => 0, size => 40 }, + { data_type => 'varchar', is_nullable => 1, size => 40 }, 'library_type', { data_type => 'varchar', is_nullable => 0, size => 40 }, 'instrument_model', @@ -181,6 +189,8 @@ __PACKAGE__->add_columns( { data_type => 'varchar', is_nullable => 0, size => 100 }, 'run_accession', { data_type => 'varchar', is_nullable => 1, size => 40 }, + 'ena_upload', + { data_type => 'tinyint', default_value => 0, is_nullable => 0 }, ); =head1 PRIMARY KEY @@ -235,7 +245,12 @@ __PACKAGE__->belongs_to( 'sample', 'WTSI::DNAP::Warehouse::Schema::Result::Sample', { id_sample_tmp => 'id_sample_tmp' }, - { is_deferrable => 1, on_delete => 'RESTRICT', on_update => 'RESTRICT' }, + { + is_deferrable => 1, + join_type => 'LEFT', + on_delete => 'RESTRICT', + on_update => 'RESTRICT', + }, ); =head2 study @@ -250,12 +265,17 @@ __PACKAGE__->belongs_to( 'study', 'WTSI::DNAP::Warehouse::Schema::Result::Study', { id_study_tmp => 'id_study_tmp' }, - { is_deferrable => 1, on_delete => 'RESTRICT', on_update => 'RESTRICT' }, + { + is_deferrable => 1, + join_type => 'LEFT', + on_delete => 'RESTRICT', + on_update => 'RESTRICT', + }, ); -# Created by DBIx::Class::Schema::Loader v0.07051 @ 2023-02-09 15:29:50 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ooVmo3tgjndSeKcqD6ynHw +# Created by DBIx::Class::Schema::Loader v0.07051 @ 2023-10-23 16:35:44 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:kLSRN187cu2gr+3cdSypqw # You can replace this text with custom code or comments, and it will be preserved on regeneration diff --git a/lib/WTSI/DNAP/Warehouse/Schema/Result/IseqExternalProductComponent.pm b/lib/WTSI/DNAP/Warehouse/Schema/Result/IseqExternalProductComponent.pm index 98ebd6b..a8863fa 100644 --- a/lib/WTSI/DNAP/Warehouse/Schema/Result/IseqExternalProductComponent.pm +++ b/lib/WTSI/DNAP/Warehouse/Schema/Result/IseqExternalProductComponent.pm @@ -149,12 +149,12 @@ __PACKAGE__->belongs_to( 'iseq_product_ext', 'WTSI::DNAP::Warehouse::Schema::Result::IseqExternalProductMetric', { id_iseq_product => 'id_iseq_product_ext' }, - { is_deferrable => 1, on_delete => 'NO ACTION', on_update => 'NO ACTION' }, + { is_deferrable => 1, on_delete => 'RESTRICT', on_update => 'RESTRICT' }, ); -# Created by DBIx::Class::Schema::Loader v0.07049 @ 2019-10-18 16:31:06 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:MZF9h1iwW2028nqp+S3KRA +# Created by DBIx::Class::Schema::Loader v0.07051 @ 2023-10-23 16:35:44 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:6qZDsJfhvxqvyeZkvdBsnw our $VERSION = '0'; diff --git a/lib/WTSI/DNAP/Warehouse/Schema/Result/IseqFlowcell.pm b/lib/WTSI/DNAP/Warehouse/Schema/Result/IseqFlowcell.pm index 20ba03e..a0ebb6a 100644 --- a/lib/WTSI/DNAP/Warehouse/Schema/Result/IseqFlowcell.pm +++ b/lib/WTSI/DNAP/Warehouse/Schema/Result/IseqFlowcell.pm @@ -563,7 +563,7 @@ __PACKAGE__->belongs_to( 'sample', 'WTSI::DNAP::Warehouse::Schema::Result::Sample', { id_sample_tmp => 'id_sample_tmp' }, - { is_deferrable => 1, on_delete => 'NO ACTION', on_update => 'NO ACTION' }, + { is_deferrable => 1, on_delete => 'RESTRICT', on_update => 'RESTRICT' }, ); =head2 study @@ -581,14 +581,14 @@ __PACKAGE__->belongs_to( { is_deferrable => 1, join_type => 'LEFT', - on_delete => 'NO ACTION', - on_update => 'NO ACTION', + on_delete => 'RESTRICT', + on_update => 'RESTRICT', }, ); -# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-05-16 15:36:45 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:WKXNoBer1TGZJNTUsLE3TA +# Created by DBIx::Class::Schema::Loader v0.07051 @ 2023-10-23 16:35:44 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:VjDSKdvECkCYaV1Nypjnzw use MooseX::Aliases; use Readonly; diff --git a/lib/WTSI/DNAP/Warehouse/Schema/Result/IseqHeronClimbStatus.pm b/lib/WTSI/DNAP/Warehouse/Schema/Result/IseqHeronClimbStatus.pm index aacc86d..65f9bc0 100644 --- a/lib/WTSI/DNAP/Warehouse/Schema/Result/IseqHeronClimbStatus.pm +++ b/lib/WTSI/DNAP/Warehouse/Schema/Result/IseqHeronClimbStatus.pm @@ -89,7 +89,6 @@ __PACKAGE__->table('iseq_heron_climb_status'); =head2 anonymous_sample_id data_type: 'varchar' - default_value: (empty string) is_nullable: 1 size: 15 @@ -130,7 +129,7 @@ __PACKAGE__->add_columns( is_nullable => 0, }, 'anonymous_sample_id', - { data_type => 'varchar', default_value => '', is_nullable => 1, size => 15 }, + { data_type => 'varchar', is_nullable => 1, size => 15 }, ); =head1 PRIMARY KEY @@ -146,8 +145,8 @@ __PACKAGE__->add_columns( __PACKAGE__->set_primary_key('id'); -# Created by DBIx::Class::Schema::Loader v0.07051 @ 2023-07-21 23:04:20 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:jToP8sVQEQTYrsDJMuxwrw +# Created by DBIx::Class::Schema::Loader v0.07051 @ 2023-10-23 16:35:44 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:3XOtKycEV9IycXJtXeepZQ # You can replace this text with custom code or comments, and it will be preserved on regeneration diff --git a/lib/WTSI/DNAP/Warehouse/Schema/Result/IseqProductAmpliconstat.pm b/lib/WTSI/DNAP/Warehouse/Schema/Result/IseqProductAmpliconstat.pm index b7a983a..9457611 100644 --- a/lib/WTSI/DNAP/Warehouse/Schema/Result/IseqProductAmpliconstat.pm +++ b/lib/WTSI/DNAP/Warehouse/Schema/Result/IseqProductAmpliconstat.pm @@ -253,12 +253,12 @@ __PACKAGE__->belongs_to( 'iseq_product', 'WTSI::DNAP::Warehouse::Schema::Result::IseqProductMetric', { id_iseq_product => 'id_iseq_product' }, - { is_deferrable => 1, on_delete => 'NO ACTION', on_update => 'NO ACTION' }, + { is_deferrable => 1, on_delete => 'RESTRICT', on_update => 'RESTRICT' }, ); -# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-09-29 13:29:47 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:BU6yKQbGElrb3nXbK9ZqIA +# Created by DBIx::Class::Schema::Loader v0.07051 @ 2023-10-23 16:35:44 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:U1ZHxtXu3hCdlMfUM81Hsg our $VERSION = '0'; diff --git a/lib/WTSI/DNAP/Warehouse/Schema/Result/IseqProductComponent.pm b/lib/WTSI/DNAP/Warehouse/Schema/Result/IseqProductComponent.pm index 38abb54..288f171 100644 --- a/lib/WTSI/DNAP/Warehouse/Schema/Result/IseqProductComponent.pm +++ b/lib/WTSI/DNAP/Warehouse/Schema/Result/IseqProductComponent.pm @@ -157,7 +157,7 @@ __PACKAGE__->belongs_to( 'iseq_product', 'WTSI::DNAP::Warehouse::Schema::Result::IseqProductMetric', { id_iseq_pr_metrics_tmp => 'id_iseq_pr_tmp' }, - { is_deferrable => 1, on_delete => 'CASCADE', on_update => 'NO ACTION' }, + { is_deferrable => 1, on_delete => 'CASCADE', on_update => 'RESTRICT' }, ); =head2 iseq_product_component @@ -172,12 +172,12 @@ __PACKAGE__->belongs_to( 'iseq_product_component', 'WTSI::DNAP::Warehouse::Schema::Result::IseqProductMetric', { id_iseq_pr_metrics_tmp => 'id_iseq_pr_component_tmp' }, - { is_deferrable => 1, on_delete => 'NO ACTION', on_update => 'NO ACTION' }, + { is_deferrable => 1, on_delete => 'RESTRICT', on_update => 'RESTRICT' }, ); -# Created by DBIx::Class::Schema::Loader v0.07049 @ 2019-02-22 16:03:28 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:wsP1sEBK1oRYk5C8X4RRag +# Created by DBIx::Class::Schema::Loader v0.07051 @ 2023-10-23 16:35:44 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:S3T1/dAm6L5h7cAAumcITw # You can replace this text with custom code or comments, and it will be preserved on regeneration diff --git a/lib/WTSI/DNAP/Warehouse/Schema/Result/IseqProductMetric.pm b/lib/WTSI/DNAP/Warehouse/Schema/Result/IseqProductMetric.pm index 492fcdf..5ee66c9 100644 --- a/lib/WTSI/DNAP/Warehouse/Schema/Result/IseqProductMetric.pm +++ b/lib/WTSI/DNAP/Warehouse/Schema/Result/IseqProductMetric.pm @@ -1001,7 +1001,7 @@ __PACKAGE__->belongs_to( is_deferrable => 1, join_type => 'LEFT', on_delete => 'SET NULL', - on_update => 'NO ACTION', + on_update => 'RESTRICT', }, ); @@ -1068,13 +1068,13 @@ __PACKAGE__->belongs_to( is_deferrable => 1, join_type => 'LEFT', on_delete => 'CASCADE', - on_update => 'NO ACTION', + on_update => 'RESTRICT', }, ); -# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-06-30 16:24:05 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:h1WsGh1UGAW4XYqkn1085Q +# Created by DBIx::Class::Schema::Loader v0.07051 @ 2023-10-23 16:35:44 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Rf7TGwVeXRjNW5a9wU8baQ # You can replace this text with custom code or comments, and it will be preserved on regeneration diff --git a/lib/WTSI/DNAP/Warehouse/Schema/Result/IseqRunInfo.pm b/lib/WTSI/DNAP/Warehouse/Schema/Result/IseqRunInfo.pm index c95547f..c3f309e 100644 --- a/lib/WTSI/DNAP/Warehouse/Schema/Result/IseqRunInfo.pm +++ b/lib/WTSI/DNAP/Warehouse/Schema/Result/IseqRunInfo.pm @@ -94,12 +94,12 @@ __PACKAGE__->belongs_to( 'run', 'WTSI::DNAP::Warehouse::Schema::Result::IseqRun', { id_run => 'id_run' }, - { is_deferrable => 1, on_delete => 'NO ACTION', on_update => 'NO ACTION' }, + { is_deferrable => 1, on_delete => 'RESTRICT', on_update => 'RESTRICT' }, ); -# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-04-01 17:33:44 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:dboQ2bkPkWQ+PRCfjf/+0A +# Created by DBIx::Class::Schema::Loader v0.07051 @ 2023-10-23 16:35:44 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:QXTesYz1PmqbMqAWCD7FLQ # You can replace this text with custom code or comments, and it will be preserved on regeneration diff --git a/lib/WTSI/DNAP/Warehouse/Schema/Result/IseqRunStatus.pm b/lib/WTSI/DNAP/Warehouse/Schema/Result/IseqRunStatus.pm index 719e1eb..b3b9d2b 100644 --- a/lib/WTSI/DNAP/Warehouse/Schema/Result/IseqRunStatus.pm +++ b/lib/WTSI/DNAP/Warehouse/Schema/Result/IseqRunStatus.pm @@ -126,12 +126,12 @@ __PACKAGE__->belongs_to( 'run_status_dict', 'WTSI::DNAP::Warehouse::Schema::Result::IseqRunStatusDict', { id_run_status_dict => 'id_run_status_dict' }, - { is_deferrable => 1, on_delete => 'NO ACTION', on_update => 'NO ACTION' }, + { is_deferrable => 1, on_delete => 'RESTRICT', on_update => 'RESTRICT' }, ); -# Created by DBIx::Class::Schema::Loader v0.07036 @ 2014-10-29 11:55:17 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:V+5Wt0FmO7gsFYyZ6NKKOQ +# Created by DBIx::Class::Schema::Loader v0.07051 @ 2023-10-23 16:35:44 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:0YSdRUTGM7gZDMHVT3JCTg our $VERSION = '0'; diff --git a/lib/WTSI/DNAP/Warehouse/Schema/Result/PacBioProductMetric.pm b/lib/WTSI/DNAP/Warehouse/Schema/Result/PacBioProductMetric.pm index 12073bf..db77372 100644 --- a/lib/WTSI/DNAP/Warehouse/Schema/Result/PacBioProductMetric.pm +++ b/lib/WTSI/DNAP/Warehouse/Schema/Result/PacBioProductMetric.pm @@ -155,7 +155,7 @@ __PACKAGE__->belongs_to( is_deferrable => 1, join_type => 'LEFT', on_delete => 'SET NULL', - on_update => 'NO ACTION', + on_update => 'RESTRICT', }, ); @@ -171,12 +171,12 @@ __PACKAGE__->belongs_to( 'pac_bio_rw_metrics', 'WTSI::DNAP::Warehouse::Schema::Result::PacBioRunWellMetric', { id_pac_bio_rw_metrics_tmp => 'id_pac_bio_rw_metrics_tmp' }, - { is_deferrable => 1, on_delete => 'CASCADE', on_update => 'NO ACTION' }, + { is_deferrable => 1, on_delete => 'CASCADE', on_update => 'RESTRICT' }, ); -# Created by DBIx::Class::Schema::Loader v0.07051 @ 2023-02-23 11:19:02 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:atOKMZwtqWTqeE7XYU1hlw +# Created by DBIx::Class::Schema::Loader v0.07051 @ 2023-10-23 16:37:17 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:FKGzjqdTCukzrRc3pEdwhw use Carp; diff --git a/lib/WTSI/DNAP/Warehouse/Schema/Result/PacBioRunWellMetric.pm b/lib/WTSI/DNAP/Warehouse/Schema/Result/PacBioRunWellMetric.pm index c49fe5b..2c355a9 100644 --- a/lib/WTSI/DNAP/Warehouse/Schema/Result/PacBioRunWellMetric.pm +++ b/lib/WTSI/DNAP/Warehouse/Schema/Result/PacBioRunWellMetric.pm @@ -835,8 +835,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07051 @ 2023-07-24 15:07:10 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:N0V6MWbIl8lBRljo07bH/g +# Created by DBIx::Class::Schema::Loader v0.07051 @ 2023-10-23 16:37:17 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:46VbvjwiguEBFKBw/8tVbQ our $VERSION = '0'; diff --git a/lib/WTSI/DNAP/Warehouse/Schema/Result/Sample.pm b/lib/WTSI/DNAP/Warehouse/Schema/Result/Sample.pm index 33f6fe4..29a7958 100644 --- a/lib/WTSI/DNAP/Warehouse/Schema/Result/Sample.pm +++ b/lib/WTSI/DNAP/Warehouse/Schema/Result/Sample.pm @@ -436,6 +436,14 @@ Developmental Stage is_nullable: 1 size: 255 +=head2 priority_level + + data_type: 'varchar' + is_nullable: 1 + size: 255 + +Priority level eg Medium, High etc + =cut __PACKAGE__->add_columns( @@ -590,6 +598,8 @@ __PACKAGE__->add_columns( { data_type => 'varchar', is_nullable => 1, size => 255 }, 'dna_source', { data_type => 'varchar', is_nullable => 1, size => 255 }, + 'priority_level', + { data_type => 'varchar', is_nullable => 1, size => 255 }, ); =head1 PRIMARY KEY @@ -788,8 +798,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07051 @ 2023-07-21 23:04:20 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:DRS5DAVcJJYnD73XvOGlzA +# Created by DBIx::Class::Schema::Loader v0.07051 @ 2023-10-23 16:35:44 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:SBUvcjIuSMo1rqiCwp0AEA our $VERSION = '0'; diff --git a/lib/WTSI/DNAP/Warehouse/Schema/Result/StudyUser.pm b/lib/WTSI/DNAP/Warehouse/Schema/Result/StudyUser.pm index c4e7866..bd3a475 100644 --- a/lib/WTSI/DNAP/Warehouse/Schema/Result/StudyUser.pm +++ b/lib/WTSI/DNAP/Warehouse/Schema/Result/StudyUser.pm @@ -147,12 +147,12 @@ __PACKAGE__->belongs_to( 'study', 'WTSI::DNAP::Warehouse::Schema::Result::Study', { id_study_tmp => 'id_study_tmp' }, - { is_deferrable => 1, on_delete => 'NO ACTION', on_update => 'NO ACTION' }, + { is_deferrable => 1, on_delete => 'RESTRICT', on_update => 'RESTRICT' }, ); -# Created by DBIx::Class::Schema::Loader v0.07036 @ 2014-10-28 10:26:31 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:qgtczY6S6fRJ5yYEvVUbRw +# Created by DBIx::Class::Schema::Loader v0.07051 @ 2023-10-23 16:35:44 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:7LbC6Gs8tMOBhxhr5HwgZQ our $VERSION = '0'; From ee52bda1aca197444c1731d14c5bf4c1fcb19459 Mon Sep 17 00:00:00 2001 From: Marina Gourtovaia Date: Mon, 23 Oct 2023 16:48:35 +0100 Subject: [PATCH 2/2] Added `last_changed` column to pac_bio_*_metrics. Added `last_changed` column to `pac_bio_run_well_metrics` and `pac_bio_product_metrics` tables. --- Changes | 7 +++++++ .../Schema/Result/PacBioProductMetric.pm | 20 +++++++++++++++++-- .../Schema/Result/PacBioRunWellMetric.pm | 20 +++++++++++++++++-- scripts/update_schema_6.30.0.sql | 7 +++++++ 4 files changed, 50 insertions(+), 4 deletions(-) create mode 100644 scripts/update_schema_6.30.0.sql diff --git a/Changes b/Changes index 99f2915..6ce51d1 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,13 @@ LIST OF CHANGES --------------- +release 6.30.0 + - To help with detecting recent changes, add `last_changed` column + to PacBio NPG tables and update relevant DBIx classes. + - Updated DBIx classes from the prod database schema. Two types of changes: + 1. due to a aserver upgrade tp MySQL v.8+ + 2. due to database schema changes. + release 6.29.1 - Switch to Perlbrew to obtain multiple Perl versions diff --git a/lib/WTSI/DNAP/Warehouse/Schema/Result/PacBioProductMetric.pm b/lib/WTSI/DNAP/Warehouse/Schema/Result/PacBioProductMetric.pm index db77372..1c5c81b 100644 --- a/lib/WTSI/DNAP/Warehouse/Schema/Result/PacBioProductMetric.pm +++ b/lib/WTSI/DNAP/Warehouse/Schema/Result/PacBioProductMetric.pm @@ -79,6 +79,15 @@ Product id The final QC outcome of the product as 0(failed), 1(passed) or NULL +=head2 last_changed + + data_type: 'datetime' + datetime_undef_if_invalid: 1 + default_value: 'CURRENT_TIMESTAMP' + is_nullable: 1 + +Date this record was created or changed + =cut __PACKAGE__->add_columns( @@ -92,6 +101,13 @@ __PACKAGE__->add_columns( { data_type => 'char', is_nullable => 0, size => 64 }, 'qc', { data_type => 'tinyint', is_nullable => 1 }, + 'last_changed', + { + data_type => 'datetime', + datetime_undef_if_invalid => 1, + default_value => 'CURRENT_TIMESTAMP', + is_nullable => 1, + }, ); =head1 PRIMARY KEY @@ -175,8 +191,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07051 @ 2023-10-23 16:37:17 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:FKGzjqdTCukzrRc3pEdwhw +# Created by DBIx::Class::Schema::Loader v0.07051 @ 2023-10-23 16:47:29 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:hTT2fzNhcm/86YuT61o2Qw use Carp; diff --git a/lib/WTSI/DNAP/Warehouse/Schema/Result/PacBioRunWellMetric.pm b/lib/WTSI/DNAP/Warehouse/Schema/Result/PacBioRunWellMetric.pm index 2c355a9..3257d1e 100644 --- a/lib/WTSI/DNAP/Warehouse/Schema/Result/PacBioRunWellMetric.pm +++ b/lib/WTSI/DNAP/Warehouse/Schema/Result/PacBioRunWellMetric.pm @@ -585,6 +585,15 @@ Number of reads with an expected barcode in demultiplexed HiFi data Number of bases in reads with an expected barcode in demultiplexed HiFi data +=head2 last_changed + + data_type: 'datetime' + datetime_undef_if_invalid: 1 + default_value: 'CURRENT_TIMESTAMP' + is_nullable: 1 + +Date this record was created or changed + =cut __PACKAGE__->add_columns( @@ -768,6 +777,13 @@ __PACKAGE__->add_columns( { data_type => 'integer', extra => { unsigned => 1 }, is_nullable => 1 }, 'hifi_bases_in_barcoded_reads', { data_type => 'bigint', extra => { unsigned => 1 }, is_nullable => 1 }, + 'last_changed', + { + data_type => 'datetime', + datetime_undef_if_invalid => 1, + default_value => 'CURRENT_TIMESTAMP', + is_nullable => 1, + }, ); =head1 PRIMARY KEY @@ -835,8 +851,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07051 @ 2023-10-23 16:37:17 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:46VbvjwiguEBFKBw/8tVbQ +# Created by DBIx::Class::Schema::Loader v0.07051 @ 2023-10-23 16:47:29 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ykO1luiH7Tjo7mWW+GGhxg our $VERSION = '0'; diff --git a/scripts/update_schema_6.30.0.sql b/scripts/update_schema_6.30.0.sql new file mode 100644 index 0000000..798c931 --- /dev/null +++ b/scripts/update_schema_6.30.0.sql @@ -0,0 +1,7 @@ +ALTER TABLE `pac_bio_run_well_metrics` + ADD COLUMN `last_changed` DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE \ + CURRENT_TIMESTAMP COMMENT 'Date this record was created or changed'; + +ALTER TABLE `pac_bio_product_metrics` + ADD COLUMN `last_changed` DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE \ + CURRENT_TIMESTAMP COMMENT 'Date this record was created or changed';