From eac18570430af03ddb6af1368e46cd838e16a192 Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Tue, 23 May 2017 08:26:59 +0100 Subject: [PATCH] rename failures column to be deferrals --- lib/App/Netdisco/DB/Result/DeviceSkip.pm | 2 +- lib/App/Netdisco/JobQueue/PostgreSQL.pm | 2 +- share/schema_versions/App-Netdisco-DB-41-42-PostgreSQL.sql | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/App/Netdisco/DB/Result/DeviceSkip.pm b/lib/App/Netdisco/DB/Result/DeviceSkip.pm index f2b555f3..ddd3db53 100644 --- a/lib/App/Netdisco/DB/Result/DeviceSkip.pm +++ b/lib/App/Netdisco/DB/Result/DeviceSkip.pm @@ -13,7 +13,7 @@ __PACKAGE__->add_columns( { data_type => "inet", is_nullable => 0 }, "action", { data_type => "text", is_nullable => 0 }, - "failures", + "deferrals", { data_type => "integer", is_nullable => 1, default_value => '0' }, "skipover", { data_type => "boolean", is_nullable => 1, default_value => \'false' }, diff --git a/lib/App/Netdisco/JobQueue/PostgreSQL.pm b/lib/App/Netdisco/JobQueue/PostgreSQL.pm index 6dcafbd6..fd1ad255 100644 --- a/lib/App/Netdisco/JobQueue/PostgreSQL.pm +++ b/lib/App/Netdisco/JobQueue/PostgreSQL.pm @@ -42,7 +42,7 @@ sub _getsome { status => 'queued', device => { '-not_in' => $jobs->correlate('skipped')->search({ backend => $fqdn, - -or => [{ failures => { '>=', 10 } },{ '-bool' => 'skipover' }], + -or => [{ deferrals => { '>=', 10 } },{ '-bool' => 'skipover' }], }, { columns => 'device' })->as_query }, %$where, }, { order_by => 'random()', rows => $num_slots }); diff --git a/share/schema_versions/App-Netdisco-DB-41-42-PostgreSQL.sql b/share/schema_versions/App-Netdisco-DB-41-42-PostgreSQL.sql index e4dfe2ee..fe573494 100644 --- a/share/schema_versions/App-Netdisco-DB-41-42-PostgreSQL.sql +++ b/share/schema_versions/App-Netdisco-DB-41-42-PostgreSQL.sql @@ -4,8 +4,8 @@ CREATE TABLE "device_skip" ( "backend" text NOT NULL, "device" inet NOT NULL, "action" text NOT NULL, - "failures" integer DEFAULT 0, - "skipover" boolean DEFAULT false, + "deferrals" integer DEFAULT 0, + "skipover" boolean DEFAULT false, PRIMARY KEY ("backend", "device", "action") );