payments table
The payments table in the E-commerce Database Schema schema has 8 columns, keyed by id, with 2 foreign keys to orders and payment_methods. 1 column in refunds references it.
Columns (8)
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | uuid | primary key | |
| order_id | uuid | not null, references orders.id | |
| payment_method_id | uuid | references payment_methods.id | |
| status | payment_status | not null | |
| amount_cents | integer | not null | |
| currency | char(3) | not null | |
| processor_reference | varchar(120) | unique | |
| captured_at | timestamptz |
Indexes (1)
(order_id, status)
Relationships
payments.order_idreferencesorders.idpayments.payment_method_idreferencespayment_methods.idrefunds.payment_idreferencespayments