booking.reservation
|
Cascading Deletes: Deleting rows from this table will cascade to: booking.resource, booking.resource, booking.resource_type. |
|
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('money.billable_xact_id_seq'::regclass) |
|
usr FK |
|
No |
||
xact_start |
|
No |
now() |
|
xact_finish |
|
Yes |
||
unrecovered |
|
Yes |
||
request_time |
|
No |
now() |
|
start_time |
|
Yes |
||
end_time |
|
Yes |
||
capture_time |
|
Yes |
||
cancel_time |
|
Yes |
||
pickup_time |
|
Yes |
||
return_time |
|
Yes |
||
booking_interval |
|
Yes |
||
fine_interval |
|
Yes |
||
fine_amount |
|
Yes |
||
max_fine |
|
Yes |
||
target_resource_type FK |
|
No |
||
target_resource FK |
|
Yes |
||
current_resource FK |
|
Yes |
||
request_lib FK |
|
No |
||
pickup_lib FK |
|
Yes |
||
capture_staff FK |
|
Yes |
||
email_notify |
|
No |
false |
|
note |
|
Yes |
Foreign Keys
| Column(s) | References | On Delete | On Update | Deferrable | Constraint |
|---|---|---|---|---|---|
|
NO ACTION |
NO ACTION |
DEFERRED |
|
|
|
NO ACTION |
NO ACTION |
DEFERRED |
|
|
|
CASCADE |
NO ACTION |
DEFERRED |
|
|
|
NO ACTION |
NO ACTION |
DEFERRED |
|
|
|
NO ACTION |
NO ACTION |
DEFERRED |
|
|
|
CASCADE |
NO ACTION |
DEFERRED |
|
|
|
CASCADE |
NO ACTION |
DEFERRED |
|
Indexes
| Index | Method | Definition |
|---|---|---|
|
btree |
|
Triggers
| Trigger | Timing | Event | Level | Function |
|---|---|---|---|---|
|
AFTER |
UPDATE |
ROW |
|
|
AFTER |
INSERT |
ROW |
|
|
AFTER |
DELETE |
ROW |
Trigger Bodies
mat_summary_change_tgr
Function: money.mat_summary_update()
Timing: AFTER UPDATE ROW
BEGIN
UPDATE money.materialized_billable_xact_summary
SET usr = NEW.usr,
xact_start = NEW.xact_start,
xact_finish = NEW.xact_finish
WHERE id = NEW.id;
RETURN NEW;
END;
mat_summary_create_tgr
Function: money.mat_summary_create()
Timing: AFTER INSERT ROW
BEGIN
INSERT INTO money.materialized_billable_xact_summary (id, usr, xact_start, xact_finish, total_paid, total_owed, balance_owed, xact_type)
VALUES ( NEW.id, NEW.usr, NEW.xact_start, NEW.xact_finish, 0.0, 0.0, 0.0, TG_ARGV[0]);
RETURN NEW;
END;
mat_summary_remove_tgr
Function: money.mat_summary_delete()
Timing: AFTER DELETE ROW
BEGIN
DELETE FROM money.materialized_billable_xact_summary WHERE id = OLD.id;
RETURN OLD;
END;
Referenced By
The following tables have foreign keys pointing to booking.reservation (3 referencing table(s)):
| Table | Referencing Column(s) | Referenced Column(s) | Constraint |
|---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|