Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refs #37859 - Fix rubocop on master #11258

Merged
merged 1 commit into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading