Skip to content

Commit

Permalink
Merge e6d8dfb into a81f27e
Browse files Browse the repository at this point in the history
  • Loading branch information
ylavoie committed Jun 10, 2023
2 parents a81f27e + e6d8dfb commit 676f905
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 0 additions & 2 deletions lib/LedgerSMB/Database.pm
Expand Up @@ -510,8 +510,6 @@ sub load_base_schema {
die 'Base schema failed to load'
if ! $success;

$self->_load_module($dbh, 'triggers.sql');

if (opendir(LOADDIR, "$self->{source_dir}/on_load")) {
while (my $fname = readdir(LOADDIR)) {
$self->run_file(
Expand Down
8 changes: 8 additions & 0 deletions sql/Pg-database.sql
Expand Up @@ -2376,6 +2376,7 @@ $$
BEGIN
-- dummy; actual function defined in modules/triggers.sql
-- exists here in order to be able to create the triggers below
RETURN new;
END;
$$ LANGUAGE PLPGSQL;

Expand Down Expand Up @@ -2418,6 +2419,7 @@ CREATE FUNCTION prevent_closed_transactions() RETURNS trigger
BEGIN
-- dummy; actual function defined in modules/triggers.sql
-- exists here in order to be able to create the triggers below
RETURN new;
END;
$$;

Expand All @@ -2437,6 +2439,11 @@ $$
BEGIN
-- dummy; actual function defined in modules/triggers.sql
-- exists here in order to be able to create the triggers below
IF tg_op = 'INSERT' OR tg_op = 'UPDATE' THEN
RETURN new;
ELSE
RETURN NULL;
END IF;
END;
$$ language plpgsql security definer;

Expand Down Expand Up @@ -2504,6 +2511,7 @@ AS
BEGIN
-- dummy; actual function defined in modules/triggers.sql
-- exists here in order to be able to create the triggers below
RETURN new;
END;
' LANGUAGE PLPGSQL;
-- end function
Expand Down

0 comments on commit 676f905

Please sign in to comment.