Skip to content

Commit

Permalink
Refs #37859 - Fix rubocop on master
Browse files Browse the repository at this point in the history
  • Loading branch information
sjha4 committed Dec 12, 2024
1 parent a153d94 commit 8b43a42
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
22 changes: 11 additions & 11 deletions db/migrate/20200213184848_create_evr_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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
Expand All @@ -43,7 +43,7 @@ def up
return FALSE;
END;
$$ language 'plpgsql';
create or replace FUNCTION isalphanum(ch CHAR)
RETURNS BOOLEAN as $$
BEGIN
Expand All @@ -56,7 +56,7 @@ def up
return FALSE;
END;
$$ language 'plpgsql';
create or replace function isdigit(ch CHAR)
RETURNS BOOLEAN as $$
BEGIN
Expand All @@ -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
Expand All @@ -84,7 +84,7 @@ def up
then
RAISE EXCEPTION 'VALUE_ERROR.';
end if;
one := str1;
<<segment_loop>>
while one <> ''
Expand All @@ -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
Expand All @@ -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
Expand Down
22 changes: 11 additions & 11 deletions db/migrate/20240924161240_katello_recreate_evr_constructs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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
Expand All @@ -46,7 +46,7 @@ def up
return FALSE;
END;
$$ language 'plpgsql';
create or replace FUNCTION isalphanum(ch CHAR)
RETURNS BOOLEAN as $$
BEGIN
Expand All @@ -59,7 +59,7 @@ def up
return FALSE;
END;
$$ language 'plpgsql';
create or replace function isdigit(ch CHAR)
RETURNS BOOLEAN as $$
BEGIN
Expand All @@ -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
Expand All @@ -87,7 +87,7 @@ def up
then
RAISE EXCEPTION 'VALUE_ERROR.';
end if;
one := str1;
<<segment_loop>>
while one <> ''
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 8b43a42

Please sign in to comment.