* Added the 'debug' parameter to System->check_alert_sent. Also updated it to use 'alert_sent_uuid'.

* Added the 'debug' parameter to System->enable_daemon.
* Fixed a bug where the old 'Tools.sql' files was being referenced instead of the new 'anvil.sql'.
* Added the 'debug' parameter to Database->initialize and Database->write. Also made it enable the postgresql daemon when initializing the DB.
* Added the 'debug' parameter to Get->host_uuid.
* Fixed the old anvil.conf variable from defaults::log::db_transactions to sys::database::log_transactions.
* Fixed a bad replacement variable name in anvil.sql.

Signed-off-by: Digimer <digimer@alteeve.ca>
main
Digimer 7 years ago
parent 4e30f2024c
commit 2170c00add
  1. 50
      Anvil/Tools/Alert.pm
  2. 50
      Anvil/Tools/Database.pm
  3. 15
      Anvil/Tools/Get.pm
  4. 11
      Anvil/Tools/System.pm
  5. 2
      anvil.conf
  6. 4
      tools/anvil-prep-database
  7. 6
      tools/anvil.sql

@ -114,11 +114,12 @@ sub check_alert_sent
my $parameter = shift;
my $anvil = $self->parent;
my $modified_date = $parameter->{modified_date} ? $parameter->{modified_date} : $anvil->data->{sys}{db_timestamp};
my $name = $parameter->{name} ? $parameter->{name} : "";
my $record_locator = $parameter->{record_locator} ? $parameter->{record_locator} : "";
my $set_by = $parameter->{set_by} ? $parameter->{set_by} : "";
my $type = $parameter->{type} ? $parameter->{type} : "";
my $debug = defined $parameter->{debug} ? $parameter->{debug} : 3;
my $modified_date = defined $parameter->{modified_date} ? $parameter->{modified_date} : $anvil->data->{sys}{db_timestamp};
my $name = defined $parameter->{name} ? $parameter->{name} : "";
my $record_locator = defined $parameter->{record_locator} ? $parameter->{record_locator} : "";
my $set_by = defined $parameter->{set_by} ? $parameter->{set_by} : "";
my $type = defined $parameter->{type} ? $parameter->{type} : "";
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => {
modified_date => $modified_date,
name => $name,
@ -172,7 +173,7 @@ sub check_alert_sent
my $query = "
SELECT
COUNT(*)
alert_sent_uuid
FROM
alert_sent
WHERE
@ -184,16 +185,17 @@ AND
AND
alert_name = ".$anvil->data->{sys}{use_db_fh}->quote($name)."
;";
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { query => $query }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { query => $query }});
# Now, if this is type=set, register the alert if it doesn't exist. If it is type=clear, remove the
# alert if it exists.
my $count = $anvil->Database->query({query => $query, source => $THIS_FILE, line => __LINE__})->[0]->[0];
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => {
type => $type,
count => $count,
my $alert_sent_uuid = $anvil->Database->query({query => $query, source => $THIS_FILE, line => __LINE__})->[0]->[0];
$alert_sent_uuid = "" if not defined $alert_sent_uuid;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => {
type => $type,
alert_sent_uuid => $alert_sent_uuid,
}});
if (($type eq "set") && (not $count))
if (($type eq "set") && (not $alert_sent_uuid))
{
### New alert
# Make sure this host is in the database... It might not be on the very first run of ScanCore
@ -209,10 +211,10 @@ FROM
WHERE
host_uuid = ".$anvil->data->{sys}{use_db_fh}->quote($anvil->data->{sys}{host_uuid})."
;";
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { query => $query }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { query => $query }});
my $count = $anvil->Database->query({query => $query, source => $THIS_FILE, line => __LINE__})->[0]->[0];
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { count => $count }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { count => $count }});
if (not $count)
{
@ -229,7 +231,7 @@ WHERE
else
{
$anvil->data->{sys}{host_is_in_db} = 1;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { 'sys::host_is_in_db' => $anvil->data->{sys}{host_is_in_db} }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { 'sys::host_is_in_db' => $anvil->data->{sys}{host_is_in_db} }});
}
}
@ -238,12 +240,14 @@ WHERE
INSERT INTO
alert_sent
(
alert_sent_uuid,
alert_sent_host_uuid,
alert_set_by,
alert_record_locator,
alert_name,
modified_date
) VALUES (
".$anvil->data->{sys}{use_db_fh}->quote($anvil->Get->uuid).",
".$anvil->data->{sys}{use_db_fh}->quote($anvil->data->{sys}{host_uuid}).",
".$anvil->data->{sys}{use_db_fh}->quote($set_by).",
".$anvil->data->{sys}{use_db_fh}->quote($record_locator).",
@ -251,13 +255,13 @@ INSERT INTO
".$anvil->data->{sys}{use_db_fh}->quote($anvil->data->{sys}{db_timestamp})."
);
";
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => {
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => {
query => $query,
set => $set,
}});
$anvil->Database->write({query => $query, source => $THIS_FILE, line => __LINE__});
}
elsif (($type eq "clear") && ($count))
elsif (($type eq "clear") && ($alert_sent_uuid))
{
# Alert previously existed, clear it.
$set = 1;
@ -265,22 +269,16 @@ INSERT INTO
DELETE FROM
alert_sent
WHERE
alert_sent_host_uuid = ".$anvil->data->{sys}{use_db_fh}->quote($anvil->data->{sys}{host_uuid})."
AND
alert_set_by = ".$anvil->data->{sys}{use_db_fh}->quote($set_by)."
AND
alert_record_locator = ".$anvil->data->{sys}{use_db_fh}->quote($record_locator)."
AND
alert_name = ".$anvil->data->{sys}{use_db_fh}->quote($name)."
alert_sent_uuid = ".$anvil->data->{sys}{use_db_fh}->quote($alert_sent_uuid)."
;";
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => {
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => {
query => $query,
set => $set,
}});
$anvil->Database->write({query => $query, source => $THIS_FILE, line => __LINE__});
}
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { set => $set }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { set => $set }});
return($set);
}

@ -223,7 +223,7 @@ sub configure_pgsql
{
# This is a minor error as it will be hit by every unpriviledged program that connects to the
# database(s).
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 2, priority => "alert", key => "log_0113"});
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 3, priority => "alert", key => "log_0113"});
return("!!error!!");
}
@ -590,7 +590,7 @@ If this is not set, no attempt to resync the database will be made.
=head3 sql_file (optional)
This is the SQL schema file that will be used to initialize the database, if the C<< test_table >> isn't found in a given database that is connected to. By default, this is C<< path::sql::Tools.sql >> (C<< /usr/share/perl/AN/Tools.sql >> by default).
This is the SQL schema file that will be used to initialize the database, if the C<< test_table >> isn't found in a given database that is connected to. By default, this is C<< path::sql::anvil.sql >> (C<< /usr/share/perl/AN/Tools.sql >> by default).
=head3 tables (optional)
@ -846,15 +846,15 @@ sub connect
if ($test_table ne $anvil->data->{defaults}{sql}{test_table})
{
my $query = "SELECT COUNT(*) FROM pg_catalog.pg_tables WHERE tablename=".$anvil->data->{sys}{use_db_fh}->quote($anvil->data->{defaults}{sql}{test_table})." AND schemaname='public';";
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { query => $query }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { query => $query }});
my $count = $anvil->Database->query({id => $id, query => $query, source => $THIS_FILE, line => __LINE__})->[0]->[0];
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { count => $count }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { count => $count }});
if ($count < 1)
{
# Need to load the database.
$anvil->Database->initialize({id => $id, sql_file => $anvil->data->{path}{sql}{'Tools.sql'}});
$anvil->Database->initialize({id => $id, sql_file => $anvil->data->{path}{sql}{'anvil.sql'}});
}
}
@ -1252,16 +1252,18 @@ sub initialize
my $anvil = $self->parent;
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 3, key => "log_0125", variables => { method => "Database->initialize()" }});
my $debug = $parameter->{debug} ? $parameter->{debug} : 3;
my $id = $parameter->{id} ? $parameter->{id} : $anvil->data->{sys}{read_db_id};
my $sql_file = $parameter->{sql_file} ? $parameter->{sql_file} : $anvil->data->{path}{sql}{'Tools.sql'};
my $sql_file = $parameter->{sql_file} ? $parameter->{sql_file} : $anvil->data->{path}{sql}{'anvil.sql'};
my $success = 1;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => {
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => {
id => $id,
sql_file => $sql_file,
}});
# This just makes some logging cleaner below.
my $say_server = $anvil->data->{database}{$id}{host}.":".$anvil->data->{database}{$id}{port}." -> ".$anvil->data->{database}{$id}{name};
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { say_server => $say_server }});
if (not $id)
{
@ -1311,22 +1313,25 @@ sub initialize
# Read in the SQL file and replace #!variable!name!# with the database owner name.
my $user = $anvil->data->{database}{$id}{user};
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { user => $user }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { user => $user }});
my $sql = $anvil->Storage->read_file({file => $sql_file});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { ">> sql" => $sql }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { ">> sql" => $sql }});
$sql =~ s/#!variable!user!#/$user/sg;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { "<< sql" => $sql }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { "<< sql" => $sql }});
# Now that I am ready, disable autocommit, write and commit.
$anvil->Database->write({id => $id, query => $sql, source => $THIS_FILE, line => __LINE__});
$anvil->data->{sys}{db_initialized}{$id} = 1;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { "sys::db_initialized::${id}" => $anvil->data->{sys}{db_initialized}{$id} }});
# Mark that we need to update the DB.
$anvil->data->{sys}{database}{resync_needed} = 1;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { "sys::database::resync_needed" => $anvil->data->{sys}{database}{resync_needed} }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { success => $success }});
return($success);
};
@ -3571,12 +3576,13 @@ sub write
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 3, key => "log_0125", variables => { method => "Database->write()" }});
my $id = $parameter->{id} ? $parameter->{id} : "";
my $debug = $parameter->{debug} ? $parameter->{debug} : 3;
my $line = $parameter->{line} ? $parameter->{line} : __LINE__;
my $query = $parameter->{query} ? $parameter->{query} : "";
my $secure = $parameter->{secure} ? $parameter->{secure} : 0;
my $source = $parameter->{source} ? $parameter->{source} : $THIS_FILE;
my $reenter = $parameter->{reenter} ? $parameter->{reenter} : "";
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => {
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => {
id => $id,
"cache::db_fh::${id}" => $anvil->data->{cache}{db_fh}{$id},
line => $line,
@ -3605,14 +3611,14 @@ sub write
my @db_ids;
if ($id)
{
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { id => $id }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { id => $id }});
push @db_ids, $id;
}
else
{
foreach my $id (sort {$a cmp $b} keys %{$anvil->data->{cache}{db_fh}})
{
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { id => $id }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { id => $id }});
push @db_ids, $id;
}
}
@ -3621,19 +3627,19 @@ sub write
my $limit = 25000;
my $count = 0;
my $query_set = [];
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { "sys::database::maximum_batch_size" => $anvil->data->{sys}{database}{maximum_batch_size} }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { "sys::database::maximum_batch_size" => $anvil->data->{sys}{database}{maximum_batch_size} }});
if ($anvil->data->{sys}{database}{maximum_batch_size})
{
if ($anvil->data->{sys}{database}{maximum_batch_size} =~ /\D/)
{
# Bad value.
$anvil->data->{sys}{database}{maximum_batch_size} = 25000;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { "sys::database::maximum_batch_size" => $anvil->data->{sys}{database}{maximum_batch_size} }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { "sys::database::maximum_batch_size" => $anvil->data->{sys}{database}{maximum_batch_size} }});
}
# Use the set value now.
$limit = $anvil->data->{sys}{database}{maximum_batch_size};
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { limit => $limit }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { limit => $limit }});
}
if (ref($query) eq "ARRAY")
{
@ -3642,7 +3648,7 @@ sub write
# If I am re-entering, then we'll proceed normally. If not, and if we have more than 10k
# queries, we'll split up the queries into 10k chunks and re-enter.
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => {
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => {
count => $count,
limit => $limit,
reenter => $reenter,
@ -3651,7 +3657,7 @@ sub write
{
my $i = 0;
my $next = $limit;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { i => $i, 'next' => $next }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { i => $i, 'next' => $next }});
foreach my $this_query (@{$query})
{
push @{$query_set}, $this_query;
@ -3696,11 +3702,11 @@ sub write
foreach my $id (@db_ids)
{
# Test access to the DB before we do the actual query
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { id => $id }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { id => $id }});
$anvil->Database->_test_access({id => $id});
# Do the actual query(ies)
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => {
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => {
id => $id,
count => $count,
}});
@ -3734,7 +3740,7 @@ sub write
}});
}
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { count => $count }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { count => $count }});
if ($count)
{
# Commit the changes.
@ -3742,7 +3748,7 @@ sub write
}
}
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { count => $count }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { count => $count }});
if ($count)
{
# Free up some memory.

@ -349,9 +349,10 @@ sub host_uuid
my $parameter = shift;
my $anvil = $self->parent;
my $set = defined $parameter->{set} ? $parameter->{set} : "";
my $debug = defined $parameter->{debug} ? $parameter->{debug} : 3;
my $set = defined $parameter->{set} ? $parameter->{set} : "";
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { set => $set }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { set => $set }});
if ($set)
{
$anvil->data->{HOST}{UUID} = $set;
@ -360,11 +361,11 @@ sub host_uuid
{
# Read dmidecode if I am root, and the cache if not.
my $uuid = "";
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { '$<' => $<, '$>' => $> }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { '$<' => $<, '$>' => $> }});
if (($< == 0) or ($> == 0))
{
my $shell_call = $anvil->data->{path}{exe}{dmidecode}." --string system-uuid";
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { shell_call => $shell_call }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { shell_call => $shell_call }});
open(my $file_handle, $shell_call." 2>&1 |") or warn $THIS_FILE." ".__LINE__."; [ Warning ] - Failed to call: [".$shell_call."], the error was: $!\n";
while(<$file_handle>)
{
@ -379,7 +380,7 @@ sub host_uuid
{
# Not running as root, so I have to rely on the cache file, or die if it doesn't
# exist.
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { 'path::data::host_uuid' => $anvil->data->{path}{data}{host_uuid} }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { 'path::data::host_uuid' => $anvil->data->{path}{data}{host_uuid} }});
if (not -e $anvil->data->{path}{data}{host_uuid})
{
# We're done.
@ -388,7 +389,7 @@ sub host_uuid
else
{
$uuid = $anvil->Storage->read_file({ file => $anvil->data->{path}{data}{host_uuid} });
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { uuid => $uuid }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { uuid => $uuid }});
}
}
@ -419,6 +420,7 @@ sub host_uuid
}
}
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { "HOST::UUID" => $anvil->data->{HOST}{UUID} }});
return($anvil->data->{HOST}{UUID});
}
@ -680,6 +682,7 @@ sub uuid
my $self = shift;
my $anvil = $self->parent;
### TODO: System calls are slow, find a pure-perl UUID generator
my $uuid = $anvil->System->call({shell_call => $anvil->data->{path}{exe}{uuidgen}." --random"});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 1, list => { uuid => $uuid }});

@ -341,22 +341,23 @@ sub enable_daemon
my $return = undef;
my $daemon = defined $parameter->{daemon} ? $parameter->{daemon} : "";
my $debug = defined $parameter->{debug} ? $parameter->{debug} : 3;
my $say_daemon = $daemon =~ /\.service$/ ? $daemon : $daemon.".service";
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { daemon => $daemon, say_daemon => $say_daemon }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { daemon => $daemon, say_daemon => $say_daemon }});
my $output = $anvil->System->call({shell_call => $anvil->data->{path}{exe}{systemctl}." enable ".$say_daemon." 2>&1; ".$anvil->data->{path}{exe}{'echo'}." return_code:\$?"});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { output => $output }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { output => $output }});
foreach my $line (split/\n/, $output)
{
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { line => $line }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { line => $line }});
if ($line =~ /return_code:(\d+)/)
{
$return = $1;
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { 'return' => $return }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { 'return' => $return }});
}
}
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 3, list => { 'return' => $return }});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { 'return' => $return }});
return($return);
}

@ -45,7 +45,7 @@ sys::database::schema = /usr/sbin/anvil/anvil.sql
# This controls whether all database transactions are recorded or not. Genreally this should be left off
# unless you are debugging the program.
# WARNING: This ignores 'secure', and will always be logged. Be careful about exposing sensitive data!
#defaults::log::db_transactions = 0
#sys::database::log_transactions = 1
# This controls what log facility to use by default.
# NOTE: This will always be 'authpriv' when a log entry is marked as secure.

@ -174,6 +174,10 @@ if ($local_id)
{
# Started the daemon.
$anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => 1, key => "log_0059"});
# Make sure it is enabled on boot.
my $return_code = $anvil->System->enable_daemon({daemon => "postgresql"});
$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { return_code => $return_code }});
}
else
{

@ -286,7 +286,7 @@ CREATE TABLE jobs (
FOREIGN KEY(job_host_uuid) REFERENCES hosts(host_uuid)
);
ALTER TABLE jobs OWNER TO #!job!user!#;
ALTER TABLE jobs OWNER TO #!variable!user!#;
CREATE TABLE history.jobs (
history_id bigserial,
@ -299,7 +299,7 @@ CREATE TABLE history.jobs (
job_description text,
modified_date timestamp with time zone not null
);
ALTER TABLE history.jobs OWNER TO #!job!user!#;
ALTER TABLE history.jobs OWNER TO #!variable!user!#;
CREATE FUNCTION history_jobs() RETURNS trigger
AS $$
@ -329,7 +329,7 @@ BEGIN
END;
$$
LANGUAGE plpgsql;
ALTER FUNCTION history_jobs() OWNER TO #!job!user!#;
ALTER FUNCTION history_jobs() OWNER TO #!variable!user!#;
CREATE TRIGGER trigger_jobs
AFTER INSERT OR UPDATE ON jobs

Loading…
Cancel
Save