From 8b43a42a4cbb04e6d669c35a20a9882393dcf572 Mon Sep 17 00:00:00 2001 From: Samir Jha Date: Thu, 12 Dec 2024 19:25:18 +0000 Subject: [PATCH] Refs #37859 - Fix rubocop on master --- db/migrate/20200213184848_create_evr_type.rb | 22 +++++++++---------- ...4161240_katello_recreate_evr_constructs.rb | 22 +++++++++---------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/db/migrate/20200213184848_create_evr_type.rb b/db/migrate/20200213184848_create_evr_type.rb index d0122e3c52a..4426fd730ff 100644 --- a/db/migrate/20200213184848_create_evr_type.rb +++ b/db/migrate/20200213184848_create_evr_type.rb @@ -9,13 +9,13 @@ def up n NUMERIC, s TEXT ); - + create type evr_t as ( epoch INT, version evr_array_item[], release evr_array_item[] ); - + CREATE FUNCTION evr_trigger() RETURNS trigger AS $$ BEGIN NEW.evr = (select ROW(coalesce(NEW.epoch::numeric,0), @@ -24,14 +24,14 @@ def up RETURN NEW; END; $$ language 'plpgsql'; - + create or replace FUNCTION empty(t TEXT) RETURNS BOOLEAN as $$ BEGIN return t ~ '^[[:space:]]*$'; END; $$ language 'plpgsql'; - + create or replace FUNCTION isalpha(ch CHAR) RETURNS BOOLEAN as $$ BEGIN @@ -43,7 +43,7 @@ def up return FALSE; END; $$ language 'plpgsql'; - + create or replace FUNCTION isalphanum(ch CHAR) RETURNS BOOLEAN as $$ BEGIN @@ -56,7 +56,7 @@ def up return FALSE; END; $$ language 'plpgsql'; - + create or replace function isdigit(ch CHAR) RETURNS BOOLEAN as $$ BEGIN @@ -67,7 +67,7 @@ def up return FALSE; END ; $$ language 'plpgsql'; - + create or replace FUNCTION rpmver_array (string1 IN VARCHAR) RETURNS evr_array_item[] as $$ declare @@ -84,7 +84,7 @@ def up then RAISE EXCEPTION 'VALUE_ERROR.'; end if; - + one := str1; <> while one <> '' @@ -111,7 +111,7 @@ def up then segm1 := substr(one, 1, length(one) - length(str1)); else segm1 := one; end if; - + if segm1 = '' then return ver_array; end if; /* arbitrary */ if isnum then @@ -124,11 +124,11 @@ def up one := str1; end; end loop segment_loop; - + return ver_array; END ; $$ language 'plpgsql'; - + SQL add_column :katello_rpms, :evr, :evr_t diff --git a/db/migrate/20240924161240_katello_recreate_evr_constructs.rb b/db/migrate/20240924161240_katello_recreate_evr_constructs.rb index 1a5367e64f2..e0a28790d26 100644 --- a/db/migrate/20240924161240_katello_recreate_evr_constructs.rb +++ b/db/migrate/20240924161240_katello_recreate_evr_constructs.rb @@ -12,13 +12,13 @@ def up n NUMERIC, s TEXT ); - + create type evr_t as ( epoch INT, version evr_array_item[], release evr_array_item[] ); - + CREATE FUNCTION evr_trigger() RETURNS trigger AS $$ BEGIN NEW.evr = (select ROW(coalesce(NEW.epoch::numeric,0), @@ -27,14 +27,14 @@ def up RETURN NEW; END; $$ language 'plpgsql'; - + create or replace FUNCTION empty(t TEXT) RETURNS BOOLEAN as $$ BEGIN return t ~ '^[[:space:]]*$'; END; $$ language 'plpgsql'; - + create or replace FUNCTION isalpha(ch CHAR) RETURNS BOOLEAN as $$ BEGIN @@ -46,7 +46,7 @@ def up return FALSE; END; $$ language 'plpgsql'; - + create or replace FUNCTION isalphanum(ch CHAR) RETURNS BOOLEAN as $$ BEGIN @@ -59,7 +59,7 @@ def up return FALSE; END; $$ language 'plpgsql'; - + create or replace function isdigit(ch CHAR) RETURNS BOOLEAN as $$ BEGIN @@ -70,7 +70,7 @@ def up return FALSE; END ; $$ language 'plpgsql'; - + create or replace FUNCTION rpmver_array (string1 IN VARCHAR) RETURNS evr_array_item[] as $$ declare @@ -87,7 +87,7 @@ def up then RAISE EXCEPTION 'VALUE_ERROR.'; end if; - + one := str1; <> while one <> '' @@ -114,7 +114,7 @@ def up then segm1 := substr(one, 1, length(one) - length(str1)); else segm1 := one; end if; - + if segm1 = '' then return ver_array; end if; /* arbitrary */ if isnum then @@ -127,11 +127,11 @@ def up one := str1; end; end loop segment_loop; - + return ver_array; END ; $$ language 'plpgsql'; - + SQL add_column :katello_rpms, :evr, :evr_t