LP1965797: Add Acq Lineitem Detail Audit Table
authorJason Stephenson <jason@sigio.com>
Thu, 14 Apr 2022 15:51:30 +0000 (11:51 -0400)
committerGalen Charlton <gmc@equinoxOLI.org>
Fri, 31 Mar 2023 15:30:42 +0000 (11:30 -0400)
Add SQL to create an audit table for acq.lineitem_detail in the base
schema creation.

The table is not added during a database upgrade.  The release notes
include instructions on creating the new table.

Signed-off-by: Jason Stephenson <jason@sigio.com>
Signed-off-by: Josh Stompro <stomproj@larl.org>
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>

Open-ILS/src/sql/Pg/201.acq.audit-functions.sql
docs/RELEASE_NOTES_NEXT/Acquisitions/lineitem_detail_auditor.adoc [new file with mode: 0644]

index c9d17b6..f107852 100644 (file)
@@ -105,4 +105,9 @@ SELECT acq.create_acq_auditor ( 'acq', 'lineitem' );
 CREATE INDEX acq_lineitem_hist_id_idx            ON acq.acq_lineitem_history( id );
 CREATE INDEX acq_lineitem_history_queued_record_idx  ON acq.acq_lineitem_history (queued_record);
 
+SELECT acq.create_acq_auditor ( 'acq', 'lineitem_detail' );
+CREATE INDEX acq_lineitem_detail_hist_id_idx ON acq.acq_lineitem_detail_history( id );
+CREATE INDEX acq_lineitem_detail_hist_lineitem_idx ON acq.acq_lineitem_detail_history( lineitem );
+CREATE INDEX acq_lineitem_detail_hist_fund_debit_idx ON acq.acq_lineitem_detail_history( fund_debit );
+
 COMMIT;
diff --git a/docs/RELEASE_NOTES_NEXT/Acquisitions/lineitem_detail_auditor.adoc b/docs/RELEASE_NOTES_NEXT/Acquisitions/lineitem_detail_auditor.adoc
new file mode 100644 (file)
index 0000000..6e09164
--- /dev/null
@@ -0,0 +1,15 @@
+== Lineitem Detail Audit Table ==
+
+The default schema has added an audit table for the
+`acq.lineitem_detail` table.  The audit table is NOT created during
+database upgrade.  If you wish to add the audit table to your
+Evergreen installation, you can run the following SQL in your
+database:
+
+[source, sql]
+----
+SELECT acq.create_acq_auditor ( 'acq', 'lineitem_detail' );
+CREATE INDEX acq_lineitem_detail_hist_id_idx ON acq.acq_lineitem_detail_history( id );
+CREATE INDEX acq_lineitem_detail_hist_lineitem_idx ON acq.acq_lineitem_detail_history( lineitem );
+CREATE INDEX acq_lineitem_detail_hist_fund_debit_idx ON acq.acq_lineitem_detail_history( fund_debit );
+----