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
fix(seed): fix schema compatibility for user_digest_preference and schema_documentation
- Fix digest_preferences -> user_digest_preference table name
- Fix documentation -> description column name in schema_documentation
- Remove reviewed column (not in current schema)
- Use username instead of user_id for digest preferences
- Fix SchemaDocumentationDedupeInitializer to check table existence before DELETE
These fixes ensure the seed script works on fresh Hibernate-created schemas.
Co-authored-by: Venkat SF <venkatesh.sakamuri@stayflexi.com>
"SELECT id FROM digest_preferences WHERE user_id = ${admin_id} AND connection_id = '${connection_id}' LIMIT 1"2>/dev/null ||echo"")"
845
+
"SELECT id FROM user_digest_preference WHERE username = '${DEEPSQL_INITIAL_ADMIN_EMAIL}' AND connection_id = '${connection_id}' LIMIT 1"2>/dev/null ||echo"")"
@@ -958,7 +958,6 @@ INSERT INTO schema_documentation (
958
958
NULL,
959
959
'Core transaction table tracking all customer orders. Status transitions: pending → confirmed → processing → shipped → delivered (or cancelled/refunded). Foreign key to customers via customer_id. Contains denormalized totals (subtotal, tax_amount, shipping_amount, discount_amount, total_amount) for query performance.',
960
960
'USER',
961
-
true,
962
961
NOW(),
963
962
NOW()
964
963
),
@@ -970,7 +969,6 @@ INSERT INTO schema_documentation (
970
969
NULL,
971
970
'Customer master table with profile and loyalty data. The tier column (bronze/silver/gold/platinum) drives discount eligibility and marketing segmentation. loyalty_points accumulate from orders and can be redeemed.',
972
971
'USER',
973
-
true,
974
972
NOW(),
975
973
NOW()
976
974
),
@@ -982,7 +980,6 @@ INSERT INTO schema_documentation (
982
980
NULL,
983
981
'Product catalog with inventory tracking. stock_quantity is decremented on order creation and incremented on returns/cancellations. low_stock_threshold triggers inventory alerts. Products can be soft-deleted via is_active=false.',
984
982
'USER',
985
-
true,
986
983
NOW(),
987
984
NOW()
988
985
),
@@ -994,7 +991,6 @@ INSERT INTO schema_documentation (
994
991
NULL,
995
992
'High-volume audit trail capturing all INSERT/UPDATE/DELETE operations. old_values and new_values store JSONB diffs. This table grows rapidly and is a candidate for partitioning by changed_at. Currently missing index on (table_name, changed_at) which causes slow queries.',
996
993
'USER',
997
-
true,
998
994
NOW(),
999
995
NOW()
1000
996
),
@@ -1006,7 +1002,6 @@ INSERT INTO schema_documentation (
1006
1002
'orders',
1007
1003
'Order lifecycle status. Valid values: pending, confirmed, processing, shipped, delivered, cancelled, refunded. Queries filtering on status should avoid LOWER() as it prevents index usage.',
0 commit comments