Entity invoice_line
Subject areas: Billing
Attributes
| # | Name | Type | Null | Default | Key | Terms | Description |
|---|---|---|---|---|---|---|---|
| 1 | invoice_id | bigint | no | PK, FK | |||
| 2 | line_no | integer | no | PK | |||
| 3 | tenant_id | domain tenant_ref (bigint) | yes | FK | |||
| 4 | description | text(200) | no | ||||
| 5 | amount | decimal(12, 2) | no |
Keys
| Kind | Name | Attributes |
|---|---|---|
| primary | pk_invoice_line | invoice_id, line_no |
Relationships
| Name | Role | Other entity | Cardinality | Attributes | Identifying | On delete | On update |
|---|---|---|---|---|---|---|---|
| invoice_line_invoice | child | invoice | one to one_or_many | invoice_line.invoice_id -> invoice.id | yes | cascade | no_action |
| invoice_line_tenant | child | tenant | one to many | invoice_line.tenant_id -> tenant.id | no | cascade | no_action |
Physical
lite (sqlite): main.invoice_line
| # | Name | Type | Null | Default | Identity | Collation | Attribute | Comment |
|---|---|---|---|---|---|---|---|---|
| 1 | invoice_id | integer | no | invoice_id | ||||
| 2 | line_no | integer | no | line_no | ||||
| 3 | tenant_id | integer | no | tenant_id | ||||
| 4 | description | text | no | description | ||||
| 5 | amount | numeric | no | amount |
- primary key pk_invoice_line (invoice_id, line_no)
- foreign key fk_invoice_line_invoice (invoice_id) references invoice (id) on delete cascade
- foreign key fk_invoice_line_tenant (tenant_id) references tenant (id) on delete cascade
- index ix_invoice_line_tenant (tenant_id)
pg (postgresql): app.invoice_line
| # | Name | Type | Null | Default | Identity | Collation | Attribute | Comment |
|---|---|---|---|---|---|---|---|---|
| 1 | invoice_id | bigint | no | invoice_id | ||||
| 2 | line_no | integer | no | line_no | ||||
| 3 | tenant_id | bigint | no | tenant_id | ||||
| 4 | description | varchar(200) | no | description | ||||
| 5 | amount | numeric(12, 2) | no | amount |
- primary key pk_invoice_line (invoice_id, line_no)
- foreign key fk_invoice_line_invoice (invoice_id) references invoice (id) on delete cascade
- foreign key fk_invoice_line_tenant (tenant_id) references tenant (id) on delete cascade
- index ix_invoice_line_tenant (tenant_id)