SchemaDatabase
Read-only map of tables, columns, and relationships in the public schema.
11 tables9 relationships152 columns
conversations_customer_id_fkey
conversationscustomer_id
→customersid
on update no actionon delete set null
messages_conversation_id_fkey
messagesconversation_id
→conversationsid
on update no actionon delete cascade
order_items_order_id_fkey
order_itemsorder_id
→ordersid
on update no actionon delete cascade
order_items_product_id_fkey
order_itemsproduct_id
→productsid
on update no actionon delete set null
order_items_stock_unit_id_fkey
order_itemsstock_unit_id
→stock_unitsid
on update no actionon delete set null
orders_customer_id_fkey
orderscustomer_id
→customersid
on update no actionon delete set null
stock_units_product_id_fkey
stock_unitsproduct_id
→productsid
on update no actionon delete cascade
storefront_checkout_intents_order_id_fkey
storefront_checkout_intentsorder_id
→ordersid
on update no actionon delete cascade
storefront_checkout_intents_product_id_fkey
storefront_checkout_intentsproduct_id
→productsid
on update no actionon delete restrict
idbigint
PKrequired
nextval('audit_logs_id_seq'::regclass)
metadatajsonb
required
'{}'::jsonb
created_attimestamp with time zone
required
now()
idbigint
PKrequired
nextval('conversations_id_seq'::regclass)
customer_idbigint
FKnullable
→ customers.id
channel_thread_keytext
required
statustext
required
'open'::text
created_attimestamp with time zone
required
now()
updated_attimestamp with time zone
required
now()
last_message_attimestamp with time zone
nullable
idbigint
PKrequired
nextval('customers_id_seq'::regclass)
created_attimestamp with time zone
required
now()
updated_attimestamp with time zone
required
now()
idbigint
PKrequired
nextval('messages_id_seq'::regclass)
conversation_idbigint
FKrequired
→ conversations.id
payloadjsonb
required
'{}'::jsonb
created_attimestamp with time zone
required
now()
idbigint
PKrequired
nextval('operator_confirmations_id_seq'::regclass)
payloadjsonb
required
'{}'::jsonb
statustext
required
'pending'::text
expires_attimestamp with time zone
required
executed_attimestamp with time zone
nullable
cancelled_attimestamp with time zone
nullable
created_attimestamp with time zone
required
now()
updated_attimestamp with time zone
required
now()
idbigint
PKrequired
nextval('order_items_id_seq'::regclass)
order_idbigint
FKrequired
→ orders.id
product_idbigint
FKnullable
→ products.id
stock_unit_idbigint
FKnullable
→ stock_units.id
title_snapshottext
required
unit_price_amountnumeric
required
currency_codetext
required
'ARS'::text
created_attimestamp with time zone
required
now()
idbigint
PKrequired
nextval('orders_id_seq'::regclass)
order_numbertext
required
concat('TOC-', upper(substr((gen_random_uuid())::text, 1, 8)))
customer_idbigint
FKnullable
→ customers.id
sourcetext
required
'manual'::text
statustext
required
'draft'::text
currency_codetext
required
'ARS'::text
subtotal_amountnumeric
required
0
total_amountnumeric
required
0
created_attimestamp with time zone
required
now()
updated_attimestamp with time zone
required
now()
idbigint
PKrequired
nextval('products_id_seq'::regclass)
conditiontext
required
'new'::text
price_amountnumeric
nullable
currency_codetext
required
'ARS'::text
activeboolean
required
true
created_attimestamp with time zone
required
now()
updated_attimestamp with time zone
required
now()
logistics_usdnumeric
nullable
total_cost_usdnumeric
nullable
margin_pctnumeric
nullable
promo_price_arsnumeric
nullable
bancarizada_totalnumeric
nullable
bancarizada_cuotanumeric
nullable
bancarizada_interestnumeric
nullable
macro_totalnumeric
nullable
macro_cuotanumeric
nullable
macro_interestnumeric
nullable
cuotas_qtyinteger
nullable
in_stockboolean
nullable
true
delivery_typetext
nullable
'immediate'::text
delivery_daysinteger
nullable
0
storage_gbinteger
nullable
battery_healthtext
nullable
legacy_source_idbigint
nullable
updated_attimestamp with time zone
required
now()
idbigint
PKrequired
nextval('stock_units_id_seq'::regclass)
product_idbigint
FKrequired
→ products.id
serial_numbertext
nullable
battery_healthinteger
nullable
statustext
required
'in_stock'::text
location_codetext
nullable
cost_amountnumeric
nullable
currency_codetext
required
'ARS'::text
acquired_attimestamp with time zone
nullable
sold_attimestamp with time zone
nullable
metadatajsonb
required
'{}'::jsonb
created_attimestamp with time zone
required
now()
updated_attimestamp with time zone
required
now()
idbigint
PKrequired
nextval('storefront_checkout_intents_id_seq'::regclass)
order_idbigint
FKrequired
→ orders.id
product_idbigint
FKrequired
→ products.id
channeltext
required
'storefront'::text
statustext
required
'created'::text
customer_phonetext
nullable
customer_nametext
nullable
title_snapshottext
required
unit_price_amountnumeric
required
currency_codetext
required
'ARS'::text
image_url_snapshottext
nullable
delivery_days_snapshotinteger
nullable
galio_reference_idtext
nullable
galio_payment_urltext
nullable
galio_proof_tokentext
nullable
galio_payment_idtext
nullable
galio_payment_statustext
nullable
metadatajsonb
required
'{}'::jsonb
paid_attimestamp with time zone
nullable
expires_attimestamp with time zone
nullable
created_attimestamp with time zone
required
now()
updated_attimestamp with time zone
required
now()