You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Đã chuẩn hóa nhiều đoạn INSERT trong backend/src/main/resources/data.sql theo kiểu có danh sách cột để tránh lỗi lệch thứ tự cột giữa các máy.
103
+
Seed mặc định hiện tại dùng `deploy/fix_seed.sql` (được generate từ `backend/src/main/resources/data.sql` để map đúng cột cho các bảng dễ lệch schema).
echo [ERROR] Failed to import seed file into %DB_NAME%.
76
85
set"MYSQL_PWD="
77
86
exit /b 1
78
87
)
79
88
89
+
call :query_scalar"SELECT COUNT(*) FROM users;" USERS_COUNT
90
+
call :query_scalar"SELECT COUNT(*) FROM products;" PRODUCTS_COUNT
91
+
call :query_scalar"SELECT COUNT(*) FROM product_variants;" VARIANTS_COUNT
92
+
call :query_scalar"SELECT COUNT(*) FROM inventory_stock;" STOCK_COUNT
93
+
call :query_scalar"SELECT COUNT(*) FROM sale_orders;" SALE_ORDERS_COUNT
94
+
call :query_scalar"SELECT COUNT(*) FROM sale_order_items;" SALE_ORDER_ITEMS_COUNT
95
+
call :query_scalar"SELECT COUNT(*) FROM tickets;" TICKETS_COUNT
96
+
call :query_scalar"SELECT COUNT(*) FROM loyalty_gifts;" LOYALTY_GIFTS_COUNT
97
+
call :query_scalar"SELECT COUNT(*) FROM product_variants pv LEFT JOIN products p ON p.id = pv.product_id LEFT JOIN units u ON u.id = pv.unit_id WHERE p.id IS NOT NULL AND u.id IS NOT NULL;" JOINABLE_VARIANTS_COUNT
98
+
call :query_scalar"SELECT COUNT(*) FROM product_variants pv LEFT JOIN products p ON p.id = pv.product_id WHERE p.id IS NULL;" ORPHAN_PRODUCT_REFS
99
+
call :query_scalar"SELECT COUNT(*) FROM product_variants pv LEFT JOIN units u ON u.id = pv.unit_id WHERE u.id IS NULL;" ORPHAN_UNIT_REFS
100
+
call :query_scalar"SELECT COUNT(DISTINCT variant_id) FROM inventory_stock WHERE COALESCE(quantity, 0) > 0;" STOCKED_VARIANTS_COUNT
0 commit comments