Restaurant Module — QA Test Data Reset
Use these SQL commands to clear restaurant data in the local dev database before a test run.
DB connection: postgresql://localhost:5435 (local dev)
Option A — Clear orders and kitchen activity only
Keeps your stations, dining areas, tables, and devices intact. Use this between test runs.
TRUNCATE TABLE
kitchen_ticket,
kds_device,
print_job,
order_bill_payment,
order_bill_mapping,
order_bill,
order_payment,
order_item,
"order",
restaurant_shift_drop,
restaurant_shift
CASCADE;
Option C — Orders + guest activity (recommended after Option A)
Clears everything in Option A plus document print jobs, reservations, and waitlist entries — all transactional data. Keeps station/area/table configuration intact.
TRUNCATE TABLE
document_print_job,
kitchen_ticket,
kds_device,
print_job,
order_bill_payment,
order_bill_mapping,
order_bill,
order_payment,
order_item,
"order",
restaurant_shift_drop,
restaurant_shift,
reservation,
waitlist_entry
CASCADE;
Option B — Full restaurant reset
Wipes everything including stations, tables, areas, devices, reservations, and price rules. Use this for a clean-slate setup.
TRUNCATE TABLE
kitchen_ticket,
kds_device,
print_job,
order_bill_payment,
order_bill_mapping,
order_bill,
order_payment,
order_item,
"order",
restaurant_shift_drop,
restaurant_shift,
product_station_assignment,
price_rule,
reservation,
waitlist_entry,
dining_table,
dining_area,
kitchen_station
CASCADE;
Also clear Redis pairing codes
After deregistering KDS devices, clear any active pairing codes from Redis:
redis-cli -p 6379 KEYS "kds:pair:station:*" | xargs redis-cli -p 6379 DEL
Table reference
| Table | What it holds |
|---|---|
dining_area | Floor plan areas (e.g. "Main Hall", "Terrace") |
dining_table | Individual tables within an area |
kitchen_station | KDS / printer stations |
product_station_assignment | Which products route to which station |
kds_device | Registered KDS tablets |
price_rule | Time/day-based price rules |
reservation | Table reservations |
waitlist_entry | Walk-in waitlist entries |
order | Restaurant orders |
order_item | Line items on an order |
order_bill | Bills generated from an order (split or full) |
order_bill_mapping | Which items belong to which bill |
order_bill_payment | Payments recorded against a bill |
order_payment | Order-level payments (legacy) |
document_print_job | Print jobs for order bill receipts (PDF delivery) |
print_job | Printer jobs for kitchen tickets |
kitchen_ticket | KDS ticket lifecycle per station |
restaurant_shift | Open/closed kitchen shifts |
restaurant_shift_drop | Cash drops recorded during a shift |
KDS pairing flow (for reference)
- Admin opens Kitchen Stations (
/forms/restaurantKitchenStations) - Click "Pair KDS device" on the target station → a 6-digit code appears with a countdown
- On the KDS screen (
/forms/restaurantKds), enter the 6-digit code - The device registers and connects to that station
To re-pair after a reset: delete the device row from kds_device (or use Option B above), then repeat the pairing flow.