Add missing email column to suppliers to fix order and delivery errors

Adds the 'email' column to the 'suppliers' table via SQL script to resolve 500 errors on `/api/orders` and `/api/deliveries` caused by missing schema information required by Drizzle ORM.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: b163d4c0-de5e-4f4e-a9c0-aed4c7049718
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/b163d4c0-de5e-4f4e-a9c0-aed4c7049718/FyjZ5oh
This commit is contained in:
michaelschal committed 2025-08-12 10:22:08 +00:00
1 parent c79ac79a91
commit c8a8b138e7
6 files changed
+605

No files matched your search

@@ -0,0 +1,200 @@
GET /api/deliveries 500 in 24ms
GET /api/orders 500 in 27ms
🔍 getUserWithGroups called for user: admin_local
🔍 getUserWithGroups called for user: admin_local
🔍 Querying user_groups for user: admin_local
🔍 Found 0 group assignments for user admin_local
🔍 Raw query result: []
✅ Processed 0 groups for user admin_local
🔍 getUserWithGroups called for user: admin_local
🔍 Querying user_groups for user: admin_local
🔍 Found 0 group assignments for user admin_local
🔍 Raw query result: []
✅ Processed 0 groups for user admin_local
🔍 getUserWithGroups called for user: admin_local
🔍 Querying user_groups for user: admin_local
🔍 Found 0 group assignments for user admin_local
🔍 Raw query result: []
✅ Processed 0 groups for user admin_local
Orders API called with: {
startDate: '2025-08-01',
endDate: '2025-08-31',
storeId: undefined,
userRole: 'admin'
}
Admin filtering with groupIds: undefined
Fetching orders by date range: 2025-08-01 to 2025-08-31
Error fetching orders: error: column orders_supplier.email does not exist
at /app/node_modules/pg-pool/index.js:45:11
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async file:///app/node_modules/drizzle-orm/node-postgres/session.js:83:22
at async DatabaseStorage.getOrdersByDateRange (file:///app/dist/index.js:1127:16)
at async file:///app/dist/index.js:3633:21 {
length: 120,
severity: 'ERROR',
code: '42703',
detail: undefined,
hint: undefined,
position: '555',
internalPosition: undefined,
internalQuery: undefined,
where: undefined,
schema: undefined,
table: undefined,
column: undefined,
dataType: undefined,
constraint: undefined,
file: 'parse_relation.c',
line: '3665',
routine: 'errorMissingColumn'
}
GET /api/orders 500 in 13ms
🔍 Querying user_groups for user: admin_local
🔍 Found 0 group assignments for user admin_local
🔍 Raw query result: []
✅ Processed 0 groups for user admin_local
🔍 getUserWithGroups called for user: admin_local
🔍 Querying user_groups for user: admin_local
🔍 Found 0 group assignments for user admin_local
🔍 Raw query result: []
✅ Processed 0 groups for user admin_local
🔍 getUserWithGroups called for user: admin_local
🔍 Querying user_groups for user: admin_local
🔍 Found 0 group assignments for user admin_local
🔍 Raw query result: []
✅ Processed 0 groups for user admin_local
Deliveries API called with: {
startDate: '2025-08-01',
endDate: '2025-08-31',
storeId: undefined,
withBL: undefined,
userRole: 'admin'
}
Admin filtering deliveries with groupIds: undefined
Fetching deliveries by date range: 2025-08-01 to 2025-08-31
Error fetching deliveries: error: column deliveries_supplier.email does not exist
at /app/node_modules/pg-pool/index.js:45:11
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async file:///app/node_modules/drizzle-orm/node-postgres/session.js:83:22
at async DatabaseStorage.getDeliveriesByDateRange (file:///app/dist/index.js:1186:25)
at async file:///app/dist/index.js:3848:25 {
length: 124,
severity: 'ERROR',
code: '42703',
detail: undefined,
hint: undefined,
position: '856',
internalPosition: undefined,
internalQuery: undefined,
where: undefined,
schema: undefined,
table: undefined,
column: undefined,
dataType: undefined,
constraint: undefined,
file: 'parse_relation.c',
line: '3665',
routine: 'errorMissingColumn'
}
GET /api/deliveries 500 in 42ms
HEAD /api/health 200 in 1ms