acq.invoice_item
|
Cascading Deletes: Deleting rows from this table will cascade to: acq.invoice. |
|
Deferrable Constraints: The following FK constraints are deferrable — they are checked at transaction end, not statement end: |
|
Trigger Side Effects: Writing to this table automatically triggers writes to other tables:
|
Columns
| Column | Type | Nullable | Default | Notes |
|---|---|---|---|---|
id PK |
|
No |
nextval('acq.invoice_item_id_seq'::regclass) |
|
invoice FK |
|
No |
||
purchase_order FK |
|
Yes |
||
fund_debit FK |
|
Yes |
||
inv_item_type FK |
|
No |
||
title |
|
Yes |
||
author |
|
Yes |
||
note |
|
Yes |
||
cost_billed |
|
Yes |
||
actual_cost |
|
Yes |
||
fund FK |
|
Yes |
||
amount_paid |
|
Yes |
||
po_item FK |
|
Yes |
||
target |
|
Yes |
Foreign Keys
| Column(s) | References | On Delete | On Update | Deferrable | Constraint |
|---|---|---|---|---|---|
|
NO ACTION |
NO ACTION |
DEFERRED |
|
|
|
NO ACTION |
NO ACTION |
DEFERRED |
|
|
|
NO ACTION |
NO ACTION |
No |
|
|
|
CASCADE |
CASCADE |
No |
|
|
|
NO ACTION |
NO ACTION |
DEFERRED |
|
|
|
SET NULL |
CASCADE |
No |
|
Indexes
| Index | Method | Definition |
|---|---|---|
|
btree |
|
|
btree |
|
|
btree |
|
|
btree |
|
|
btree |
|
Triggers
| Trigger | Timing | Event | Level | Function |
|---|---|---|---|---|
|
AFTER |
DELETE OR UPDATE |
ROW |
Trigger Bodies
audit_acq_invoice_item_update_trigger
Function: auditor.audit_acq_invoice_item_func()
Timing: AFTER DELETE OR UPDATE ROW
BEGIN
INSERT INTO auditor.acq_invoice_item_history ( audit_id, audit_time, audit_action, audit_user, audit_ws, id, invoice, purchase_order, fund_debit, inv_item_type, title, author, note, cost_billed, actual_cost, fund, amount_paid, po_item, target )
SELECT nextval('auditor.acq_invoice_item_pkey_seq'),
now(),
SUBSTR(TG_OP,1,1),
eg_user,
eg_ws,
OLD.id, OLD.invoice, OLD.purchase_order, OLD.fund_debit, OLD.inv_item_type, OLD.title, OLD.author, OLD.note, OLD.cost_billed, OLD.actual_cost, OLD.fund, OLD.amount_paid, OLD.po_item, OLD.target
FROM auditor.get_audit_info();
RETURN NULL;
END;