Entity payment

Subject areas: Sales

Attributes

#NameTypeNullDefaultKeyTermsDescription
1idbigintnoPK
2order_idbigintnoFK
3reference_nobigintnoUQ
4amountdomain money (decimal(12, 2))no0
5paid_attimestamptznoexpr "now()"

Keys

KindNameAttributes
primarypk_paymentid
uniqueuq_payment_referencereference_no

Relationships

NameRoleOther entityCardinalityAttributesIdentifyingOn deleteOn update
payment_orderchildorderone to manypayment.order_id -> order.idnono_actionno_action

Physical

lite (sqlite): main.payment

#NameTypeNullDefaultIdentityCollationAttributeComment
1idintegernoby_defaultid
2order_idintegernoorder_id
3reference_nointegernoreference_no
4amountnumericno0amount
5paid_attextnoexpr "CURRENT_TIMESTAMP"paid_at

pg (postgresql): public.payment

#NameTypeNullDefaultIdentityCollationAttributeComment
1idbigintnoalwaysid
2order_idbigintnoorder_id
3reference_nobigintnoexpr "nextval('payment_reference_seq')"reference_no
4amountnumeric(12, 2)no0amount
5paid_attimestamp with time zonenoexpr "now()"paid_at