Skip to content

Commit

Permalink
Fix Layout/TrailingWhitespace cop
Browse files Browse the repository at this point in the history
  • Loading branch information
archanaserver committed Jul 31, 2024
1 parent 3071bae commit f3f34f6
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/20240624121212_katello_recreate_evr_constructs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ def change
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 @@ -30,14 +30,14 @@ def change
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 @@ -49,7 +49,7 @@ def change
return FALSE;
END;
$$ language 'plpgsql';
create or replace FUNCTION isalphanum(ch CHAR)
RETURNS BOOLEAN as $$
BEGIN
Expand All @@ -62,7 +62,7 @@ def change
return FALSE;
END;
$$ language 'plpgsql';
create or replace function isdigit(ch CHAR)
RETURNS BOOLEAN as $$
BEGIN
Expand All @@ -73,7 +73,7 @@ def change
return FALSE;
END ;
$$ language 'plpgsql';
create or replace FUNCTION rpmver_array (string1 IN VARCHAR)
RETURNS evr_array_item[] as $$
declare
Expand All @@ -90,7 +90,7 @@ def change
then
RAISE EXCEPTION 'VALUE_ERROR.';
end if;
one := str1;
<<segment_loop>>
while one <> ''
Expand All @@ -117,7 +117,7 @@ def change
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 @@ -130,11 +130,11 @@ def change
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 f3f34f6

Please sign in to comment.