Table "cafe.kitchen_orders" Column | Type | Collation | Nullable | Default ---------------+--------------------------+-----------+----------+-------------------------- id | uuid | | not null | gen_random_uuid() tenant_id | uuid | | not null | shop_id | uuid | | not null | session_id | uuid | | not null | odoo_order_id | integer | | | order_name | character varying(50) | | not null | status | character varying(20) | | not null | 'new'::character varying payload | jsonb | | not null | note | text | | | queued_at | timestamp with time zone | | not null | CURRENT_TIMESTAMP started_at | timestamp with time zone | | | ready_at | timestamp with time zone | | | served_at | timestamp with time zone | | | Indexes: "kitchen_orders_pkey" PRIMARY KEY, btree (id) "cafe_kitchen_orders_session_idx" btree (session_id) "cafe_kitchen_orders_shop_queued_idx" btree (shop_id, queued_at) "cafe_kitchen_orders_tenant_shop_status_idx" btree (tenant_id, shop_id, status) Check constraints: "cafe_kitchen_orders_status_check" CHECK (status::text = ANY (ARRAY['new'::character varying, 'preparing'::character varying, 'ready'::character varying, 'served'::character varying, 'cancelled'::character varying]::text[])) Foreign-key constraints: "kitchen_orders_session_id_foreign" FOREIGN KEY (session_id) REFERENCES cafe.sessions(id) ON DELETE CASCADE "kitchen_orders_shop_id_foreign" FOREIGN KEY (shop_id) REFERENCES commerce.shops(id) ON DELETE CASCADE "kitchen_orders_tenant_id_foreign" FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON DELETE CASCADE