From bce81dd8397140c8f5904f9ac6c111557e905fad Mon Sep 17 00:00:00 2001 From: Andreas Romeyke <andreas.romeyke@slub-dresden.de> Date: Thu, 19 Sep 2024 20:34:27 +0200 Subject: [PATCH] - removed state from tables 'deleted' and 'purged' --- perl/exit_strategy.pl | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/perl/exit_strategy.pl b/perl/exit_strategy.pl index 573683d..76fffbf 100644 --- a/perl/exit_strategy.pl +++ b/perl/exit_strategy.pl @@ -152,7 +152,6 @@ SQL_CREATE5 CREATE TABLE deleted ( id INTEGER, aip_id INTEGER NOT NULL REFERENCES aip (id), - state TEXT NOT NULL, reason TEXT NOT NULL, note TEXT, date DATE, @@ -164,7 +163,6 @@ SQL_CREATE6 CREATE TABLE purged ( id INTEGER, aip_id INTEGER NOT NULL REFERENCES aip (id), - state TEXT NOT NULL, reason TEXT, note TEXT, date DATE, @@ -227,13 +225,13 @@ SQL_LOCAT_PLAN ); SQL_DC_PLAN my $sql_deleted_plan=<<"SQL_DELETE_PLAN"; - INSERT INTO deleted (aip_id, state, reason, note, date, authorized_by) VALUES ( - (SELECT id FROM aip WHERE aip.ie_id=\$1 AND aip.version=\$2), \$3, \$4, \$5, \$6, \$7 + INSERT INTO deleted (aip_id, reason, note, date, authorized_by) VALUES ( + (SELECT id FROM aip WHERE aip.ie_id=\$1 AND aip.version=\$2), \$3, \$4, \$5, \$6 ); SQL_DELETE_PLAN my $sql_purged_plan=<<"SQL_PURGED_PLAN"; - INSERT INTO purged (aip_id, state, reason, note, date, authorized_by) VALUES ( - (SELECT id FROM aip WHERE aip.ie_id=\$1 AND aip.version=\$2), \$3, \$4, \$5, \$6, \$7 + INSERT INTO purged (aip_id, reason, note, date, authorized_by) VALUES ( + (SELECT id FROM aip WHERE aip.ie_id=\$1 AND aip.version=\$2), \$3, \$4, \$5, \$6 ); SQL_PURGED_PLAN @@ -334,8 +332,8 @@ SQL_PURGED_PLAN my $date = $delete->{'date'}; my $authorized_by = $delete->{'authorized_by'}; eval { - $plans->{$delstate}->execute($ieid, $ieversion, $state, $reason, $note, $date, $authorized_by) - } or die "sql problem detected with $delstate $ieid ($ieversion, $state, $reason, $note, $date, $authorized_by), ", $dbh->errstr; + $plans->{$delstate}->execute($ieid, $ieversion, $reason, $note, $date, $authorized_by) + } or die "sql problem detected with $delstate $ieid ($ieversion, $reason, $note, $date, $authorized_by), ", $dbh->errstr; } } return 1; -- GitLab