| # | Column Name | Nullable | Data Type | Max Length | Description |
|---|---|---|---|---|---|
| 1 | recurring_invoice_id | integer | 0 | The primary key of this table, which is also a serial field. | |
| 2 | recurring_invoice_code | character varying | 12 | ||
| 3 | recurring_invoice_name | character varying | 50 | ||
| 4 | item_id | integer | 0 | Foreign key to the table core.items. | |
| 5 | compound_item_id | integer | 0 | ||
| 6 | recurring_frequency_id | integer | 0 | ||
| 7 | recurring_amount | money_strict | 0 | ||
| 8 | auto_trigger_on_sales | boolean | 0 | ||
| 9 | audit_user_id | integer | 0 | Contains the id of the user who last inserted or updated the corresponding row. | |
| 10 | audit_ts | timestamp with time zone | 0 | Contains the date and timestamp of the last insert or update action. |
| # | Column Name | Key Name | References |
|---|---|---|---|
| 4 | item_id | recurring_invoices_item_id_fkey | core.items.item_id |
| 5 | compound_item_id | recurring_invoices_compound_item_id_fkey | core.compound_items.compound_item_id |
| 6 | recurring_frequency_id | recurring_invoices_recurring_frequency_id_fkey | core.frequencies.frequency_id |
| 9 | audit_user_id | recurring_invoices_audit_user_id_fkey | office.users.user_id |
| Index Name | Owner | Access Method | Definition | Description |
|---|---|---|---|---|
| recurring_invoices_pkey | postgres | btree | recurring_invoice_id | |
| recurring_invoices_compound_item_id_auto_trigger_on_sales_uix | postgres | btree | compound_item_id auto_trigger_on_sales | |
| recurring_invoices_item_id_auto_trigger_on_sales_uix | postgres | btree | item_id auto_trigger_on_sales |
| Constraint Name | Description |
|---|---|
| recurring_invoices_recurring_amount_chk CHECK (recurring_amount::numeric > 0::numeric) | |
| recurring_invoices_item_chk CHECK (((item_id IS NULL)::integer + (compound_item_id IS NULL)::integer) = 1) |
| # | Column Name | Default |
|---|---|---|
| 1 | recurring_invoice_id | nextval('core.recurring_invoices_recurring_invoice_id_seq'::regclass) |
| 10 | audit_ts | now() |
| Trigger Name | Targets | On Event | Timing | Condition | Order | Orientation | Description |
|---|