From 233e485a552438834da68463a720de0f509d13e1 Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Mon, 4 Mar 2013 16:32:16 -0500 Subject: [PATCH] Remove the BuildMachines and BuildMachinesSystemTypes tables --- .../Hydra/Schema/BuildMachineSystemTypes.pm | 83 ------------ src/lib/Hydra/Schema/BuildMachines.pm | 121 ------------------ src/sql/hydra.sql | 19 --- src/sql/upgrade-11.sql | 2 + tests/query-all-tables.pl | 2 +- 5 files changed, 3 insertions(+), 224 deletions(-) delete mode 100644 src/lib/Hydra/Schema/BuildMachineSystemTypes.pm delete mode 100644 src/lib/Hydra/Schema/BuildMachines.pm create mode 100644 src/sql/upgrade-11.sql diff --git a/src/lib/Hydra/Schema/BuildMachineSystemTypes.pm b/src/lib/Hydra/Schema/BuildMachineSystemTypes.pm deleted file mode 100644 index 8675b3e6..00000000 --- a/src/lib/Hydra/Schema/BuildMachineSystemTypes.pm +++ /dev/null @@ -1,83 +0,0 @@ -use utf8; -package Hydra::Schema::BuildMachineSystemTypes; - -# Created by DBIx::Class::Schema::Loader -# DO NOT MODIFY THE FIRST PART OF THIS FILE - -=head1 NAME - -Hydra::Schema::BuildMachineSystemTypes - -=cut - -use strict; -use warnings; - -use base 'DBIx::Class::Core'; - -=head1 TABLE: C - -=cut - -__PACKAGE__->table("BuildMachineSystemTypes"); - -=head1 ACCESSORS - -=head2 hostname - - data_type: 'text' - is_foreign_key: 1 - is_nullable: 0 - -=head2 system - - data_type: 'text' - is_nullable: 0 - -=cut - -__PACKAGE__->add_columns( - "hostname", - { data_type => "text", is_foreign_key => 1, is_nullable => 0 }, - "system", - { data_type => "text", is_nullable => 0 }, -); - -=head1 PRIMARY KEY - -=over 4 - -=item * L - -=item * L - -=back - -=cut - -__PACKAGE__->set_primary_key("hostname", "system"); - -=head1 RELATIONS - -=head2 hostname - -Type: belongs_to - -Related object: L - -=cut - -__PACKAGE__->belongs_to( - "hostname", - "Hydra::Schema::BuildMachines", - { hostname => "hostname" }, - { is_deferrable => 0, on_delete => "CASCADE", on_update => "NO ACTION" }, -); - - -# Created by DBIx::Class::Schema::Loader v0.07033 @ 2013-01-22 13:29:36 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:im3sfvrv5YY3i1IAOozeiA - - -# You can replace this text with custom content, and it will be preserved on regeneration -1; diff --git a/src/lib/Hydra/Schema/BuildMachines.pm b/src/lib/Hydra/Schema/BuildMachines.pm deleted file mode 100644 index a6d081ff..00000000 --- a/src/lib/Hydra/Schema/BuildMachines.pm +++ /dev/null @@ -1,121 +0,0 @@ -use utf8; -package Hydra::Schema::BuildMachines; - -# Created by DBIx::Class::Schema::Loader -# DO NOT MODIFY THE FIRST PART OF THIS FILE - -=head1 NAME - -Hydra::Schema::BuildMachines - -=cut - -use strict; -use warnings; - -use base 'DBIx::Class::Core'; - -=head1 TABLE: C - -=cut - -__PACKAGE__->table("BuildMachines"); - -=head1 ACCESSORS - -=head2 hostname - - data_type: 'text' - is_nullable: 0 - -=head2 username - - data_type: 'text' - default_value: (empty string) - is_nullable: 0 - -=head2 ssh_key - - data_type: 'text' - default_value: (empty string) - is_nullable: 0 - -=head2 options - - data_type: 'text' - default_value: (empty string) - is_nullable: 0 - -=head2 maxconcurrent - - data_type: 'integer' - default_value: 2 - is_nullable: 0 - -=head2 speedfactor - - data_type: 'integer' - default_value: 1 - is_nullable: 0 - -=head2 enabled - - data_type: 'integer' - default_value: 0 - is_nullable: 0 - -=cut - -__PACKAGE__->add_columns( - "hostname", - { data_type => "text", is_nullable => 0 }, - "username", - { data_type => "text", default_value => "", is_nullable => 0 }, - "ssh_key", - { data_type => "text", default_value => "", is_nullable => 0 }, - "options", - { data_type => "text", default_value => "", is_nullable => 0 }, - "maxconcurrent", - { data_type => "integer", default_value => 2, is_nullable => 0 }, - "speedfactor", - { data_type => "integer", default_value => 1, is_nullable => 0 }, - "enabled", - { data_type => "integer", default_value => 0, is_nullable => 0 }, -); - -=head1 PRIMARY KEY - -=over 4 - -=item * L - -=back - -=cut - -__PACKAGE__->set_primary_key("hostname"); - -=head1 RELATIONS - -=head2 buildmachinesystemtypes - -Type: has_many - -Related object: L - -=cut - -__PACKAGE__->has_many( - "buildmachinesystemtypes", - "Hydra::Schema::BuildMachineSystemTypes", - { "foreign.hostname" => "self.hostname" }, - undef, -); - - -# Created by DBIx::Class::Schema::Loader v0.07033 @ 2013-01-22 13:29:36 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:OST5IMcvHKsXlNMCRazXhg - - -# You can replace this text with custom content, and it will be preserved on regeneration -1; diff --git a/src/sql/hydra.sql b/src/sql/hydra.sql index 4ff9d9c5..c1c68104 100644 --- a/src/sql/hydra.sql +++ b/src/sql/hydra.sql @@ -513,25 +513,6 @@ create table NewsItems ( ); -create table BuildMachines ( - hostname text primary key not null, - username text default '' not null, - ssh_key text default '' not null, - options text default '' not null, - maxconcurrent integer default 2 not null, - speedfactor integer default 1 not null, - enabled integer default 0 not null -); - - -create table BuildMachineSystemTypes ( - hostname text NOT NULL, - system text NOT NULL, - primary key (hostname, system), - foreign key (hostname) references BuildMachines(hostname) on delete cascade -); - - -- Some indices. create index IndexBuildInputsOnBuild on BuildInputs(build); diff --git a/src/sql/upgrade-11.sql b/src/sql/upgrade-11.sql new file mode 100644 index 00000000..174a647c --- /dev/null +++ b/src/sql/upgrade-11.sql @@ -0,0 +1,2 @@ +drop table BuildMachineSystemTypes; +drop table BuildMachines; diff --git a/tests/query-all-tables.pl b/tests/query-all-tables.pl index 19aee924..55cc779f 100755 --- a/tests/query-all-tables.pl +++ b/tests/query-all-tables.pl @@ -7,7 +7,7 @@ my $db = Hydra::Model::DB->new; my @sources = $db->schema->sources; my $nrtables = scalar(@sources); -use Test::Simple tests => 45; +use Test::Simple tests => 43; foreach my $source (@sources) { my $title = "Basic select query for $source";