From e6bde1cea2201b82b1fd9368b2f14f9293b23bd6 Mon Sep 17 00:00:00 2001 From: Marina Gourtovaia Date: Tue, 9 Apr 2024 10:46:39 +0100 Subject: [PATCH] Stopped generating InstrumentFormat ORM class. Dropped instrument_utilisation table from the db schema, which is used for testing the tracking web application. 'instrument_utilisation' table has not been used for the last seven years. The code that filled it in was deleted some time ago. Once this change is released, the 'instrument_utilisation' table can be dropped from the prod. database. --- MANIFEST | 1 - .../Schema/Result/InstrumentFormat.pm | 19 +- .../Schema/Result/InstrumentUtilisation.pm | 275 ------------------ scripts/npg_tracking_dbix_schema_loader.pl | 1 + t/data/schema.txt | 27 -- 5 files changed, 3 insertions(+), 320 deletions(-) delete mode 100644 lib/npg_tracking/Schema/Result/InstrumentUtilisation.pm diff --git a/MANIFEST b/MANIFEST index fb1d55f3..433b1834 100644 --- a/MANIFEST +++ b/MANIFEST @@ -241,7 +241,6 @@ lib/npg_tracking/Schema/Result/InstrumentModDict.pm lib/npg_tracking/Schema/Result/InstrumentStatus.pm lib/npg_tracking/Schema/Result/InstrumentStatusAnnotation.pm lib/npg_tracking/Schema/Result/InstrumentStatusDict.pm -lib/npg_tracking/Schema/Result/InstrumentUtilisation.pm lib/npg_tracking/Schema/Result/Manufacturer.pm lib/npg_tracking/Schema/Result/Run.pm lib/npg_tracking/Schema/Result/RunAnnotation.pm diff --git a/lib/npg_tracking/Schema/Result/InstrumentFormat.pm b/lib/npg_tracking/Schema/Result/InstrumentFormat.pm index 036b7a20..3c0d81c5 100644 --- a/lib/npg_tracking/Schema/Result/InstrumentFormat.pm +++ b/lib/npg_tracking/Schema/Result/InstrumentFormat.pm @@ -147,21 +147,6 @@ __PACKAGE__->set_primary_key("id_instrument_format"); =head1 RELATIONS -=head2 instrument_utilisations - -Type: has_many - -Related object: L - -=cut - -__PACKAGE__->has_many( - "instrument_utilisations", - "npg_tracking::Schema::Result::InstrumentUtilisation", - { "foreign.id_instrument_format" => "self.id_instrument_format" }, - { cascade_copy => 0, cascade_delete => 0 }, -); - =head2 instruments Type: has_many @@ -208,8 +193,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07051 @ 2023-10-23 17:02:30 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:esNDL3mLvW19/fKjWfsX/g +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2024-04-09 10:35:17 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:elkjaVkCGUOAo8WzkpdV/A # Author: david.jackson@sanger.ac.uk # Created: 2010-04-08 diff --git a/lib/npg_tracking/Schema/Result/InstrumentUtilisation.pm b/lib/npg_tracking/Schema/Result/InstrumentUtilisation.pm deleted file mode 100644 index b5af0f96..00000000 --- a/lib/npg_tracking/Schema/Result/InstrumentUtilisation.pm +++ /dev/null @@ -1,275 +0,0 @@ -use utf8; -package npg_tracking::Schema::Result::InstrumentUtilisation; - -# Created by DBIx::Class::Schema::Loader -# DO NOT MODIFY THE FIRST PART OF THIS FILE - -=head1 NAME - -npg_tracking::Schema::Result::InstrumentUtilisation - -=cut - -use strict; -use warnings; - -use Moose; -use MooseX::NonMoose; -use MooseX::MarkAsMethods autoclean => 1; -extends 'DBIx::Class::Core'; - -=head1 COMPONENTS LOADED - -=over 4 - -=item * L - -=back - -=cut - -__PACKAGE__->load_components("InflateColumn::DateTime"); - -=head1 TABLE: C - -=cut - -__PACKAGE__->table("instrument_utilisation"); - -=head1 ACCESSORS - -=head2 id_instrument_utilisation - - data_type: 'bigint' - extra: {unsigned => 1} - is_auto_increment: 1 - is_nullable: 0 - -=head2 date - - data_type: 'date' - datetime_undef_if_invalid: 1 - is_nullable: 0 - -=head2 total_insts - - data_type: 'integer' - default_value: 0 - extra: {unsigned => 1} - is_nullable: 0 - -=head2 perc_utilisation_total_insts - - data_type: 'float' - default_value: 0.00 - extra: {unsigned => 1} - is_nullable: 0 - size: [5,2] - -=head2 perc_uptime_total_insts - - data_type: 'float' - default_value: 0.00 - extra: {unsigned => 1} - is_nullable: 0 - size: [5,2] - -=head2 official_insts - - data_type: 'integer' - default_value: 0 - extra: {unsigned => 1} - is_nullable: 0 - -=head2 perc_utilisation_official_insts - - data_type: 'float' - default_value: 0.00 - extra: {unsigned => 1} - is_nullable: 0 - size: [5,2] - -=head2 perc_uptime_official_insts - - data_type: 'float' - default_value: 0.00 - extra: {unsigned => 1} - is_nullable: 0 - size: [5,2] - -=head2 prod_insts - - data_type: 'integer' - default_value: 0 - extra: {unsigned => 1} - is_nullable: 0 - -=head2 perc_utilisation_prod_insts - - data_type: 'float' - default_value: 0.00 - extra: {unsigned => 1} - is_nullable: 0 - size: [5,2] - -=head2 perc_uptime_prod_insts - - data_type: 'float' - default_value: 0.00 - extra: {unsigned => 1} - is_nullable: 0 - size: [5,2] - -=head2 id_instrument_format - - data_type: 'bigint' - extra: {unsigned => 1} - is_foreign_key: 1 - is_nullable: 0 - -=cut - -__PACKAGE__->add_columns( - "id_instrument_utilisation", - { - data_type => "bigint", - extra => { unsigned => 1 }, - is_auto_increment => 1, - is_nullable => 0, - }, - "date", - { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 0 }, - "total_insts", - { - data_type => "integer", - default_value => 0, - extra => { unsigned => 1 }, - is_nullable => 0, - }, - "perc_utilisation_total_insts", - { - data_type => "float", - default_value => "0.00", - extra => { unsigned => 1 }, - is_nullable => 0, - size => [5, 2], - }, - "perc_uptime_total_insts", - { - data_type => "float", - default_value => "0.00", - extra => { unsigned => 1 }, - is_nullable => 0, - size => [5, 2], - }, - "official_insts", - { - data_type => "integer", - default_value => 0, - extra => { unsigned => 1 }, - is_nullable => 0, - }, - "perc_utilisation_official_insts", - { - data_type => "float", - default_value => "0.00", - extra => { unsigned => 1 }, - is_nullable => 0, - size => [5, 2], - }, - "perc_uptime_official_insts", - { - data_type => "float", - default_value => "0.00", - extra => { unsigned => 1 }, - is_nullable => 0, - size => [5, 2], - }, - "prod_insts", - { - data_type => "integer", - default_value => 0, - extra => { unsigned => 1 }, - is_nullable => 0, - }, - "perc_utilisation_prod_insts", - { - data_type => "float", - default_value => "0.00", - extra => { unsigned => 1 }, - is_nullable => 0, - size => [5, 2], - }, - "perc_uptime_prod_insts", - { - data_type => "float", - default_value => "0.00", - extra => { unsigned => 1 }, - is_nullable => 0, - size => [5, 2], - }, - "id_instrument_format", - { - data_type => "bigint", - extra => { unsigned => 1 }, - is_foreign_key => 1, - is_nullable => 0, - }, -); - -=head1 PRIMARY KEY - -=over 4 - -=item * L - -=back - -=cut - -__PACKAGE__->set_primary_key("id_instrument_utilisation"); - -=head1 UNIQUE CONSTRAINTS - -=head2 C - -=over 4 - -=item * L - -=item * L - -=back - -=cut - -__PACKAGE__->add_unique_constraint("uidx_date_format", ["date", "id_instrument_format"]); - -=head1 RELATIONS - -=head2 instrument_format - -Type: belongs_to - -Related object: L - -=cut - -__PACKAGE__->belongs_to( - "instrument_format", - "npg_tracking::Schema::Result::InstrumentFormat", - { id_instrument_format => "id_instrument_format" }, - { is_deferrable => 1, on_delete => "RESTRICT", on_update => "RESTRICT" }, -); - - -# Created by DBIx::Class::Schema::Loader v0.07051 @ 2023-10-23 17:02:30 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:rbmVI5hlEgTZFDj665rTkw - -# Author: david.jackson@sanger.ac.uk -# Created: 2010-04-08 - -our $VERSION = '0'; - -__PACKAGE__->meta->make_immutable; -1; diff --git a/scripts/npg_tracking_dbix_schema_loader.pl b/scripts/npg_tracking_dbix_schema_loader.pl index 3e790c15..dbd00e91 100755 --- a/scripts/npg_tracking_dbix_schema_loader.pl +++ b/scripts/npg_tracking_dbix_schema_loader.pl @@ -29,6 +29,7 @@ use_moose => 1, preserve_case => 1, use_namespaces => 1, + exclude => qr/instrument_utilisation/, rel_name_map => sub { # Rename the id relationship so we can access flat versions of diff --git a/t/data/schema.txt b/t/data/schema.txt index f780813d..45caa00d 100644 --- a/t/data/schema.txt +++ b/t/data/schema.txt @@ -293,33 +293,6 @@ CREATE TABLE `instrument_status_dict` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; --- --- Table structure for table `instrument_utilisation` --- - -DROP TABLE IF EXISTS `instrument_utilisation`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `instrument_utilisation` ( - `id_instrument_utilisation` bigint(20) unsigned NOT NULL AUTO_INCREMENT, - `date` date NOT NULL, - `total_insts` int(4) unsigned NOT NULL DEFAULT '0', - `perc_utilisation_total_insts` float(5,2) unsigned NOT NULL DEFAULT '0.00', - `perc_uptime_total_insts` float(5,2) unsigned NOT NULL DEFAULT '0.00', - `official_insts` int(4) unsigned NOT NULL DEFAULT '0', - `perc_utilisation_official_insts` float(5,2) unsigned NOT NULL DEFAULT '0.00', - `perc_uptime_official_insts` float(5,2) unsigned NOT NULL DEFAULT '0.00', - `prod_insts` int(4) unsigned NOT NULL DEFAULT '0', - `perc_utilisation_prod_insts` float(5,2) unsigned NOT NULL DEFAULT '0.00', - `perc_uptime_prod_insts` float(5,2) unsigned NOT NULL DEFAULT '0.00', - `id_instrument_format` bigint(20) unsigned NOT NULL, - PRIMARY KEY (`id_instrument_utilisation`), - UNIQUE KEY `uidx_date_format` (`date`,`id_instrument_format`), - KEY `inst_format` (`id_instrument_format`), - CONSTRAINT `inst_format` FOREIGN KEY (`id_instrument_format`) REFERENCES `instrument_format` (`id_instrument_format`) ON DELETE NO ACTION ON UPDATE NO ACTION -) ENGINE=InnoDB DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; - -- -- Table structure for table `manufacturer` --