From 49a1325d7f96ea373a2e1c65cfc1e0803cee8505 Mon Sep 17 00:00:00 2001 From: michaelschal <35957947-michaelschal@users.noreply.replit.com> Date: Wed, 13 Aug 2025 12:41:11 +0000 Subject: [PATCH] Ensure system connects to the production database for accurate data Force the use of DatabaseStorage in all environments to access real PostgreSQL data, overriding previous development configurations. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 7c468936-2a88-4686-ac0a-84921a45222d Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/7c468936-2a88-4686-ac0a-84921a45222d/fY3G4XT --- cookies.txt | 2 +- server/storage.ts | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/cookies.txt b/cookies.txt index f63d116..ab83372 100644 --- a/cookies.txt +++ b/cookies.txt @@ -2,4 +2,4 @@ # https://curl.se/docs/http-cookies.html # This file was generated by libcurl! Edit at your own risk. -#HttpOnly_localhost FALSE / FALSE 1755175168 connect.sid s%3AXOwkelwwA5ZeDs-gJuKcdEXK9b4Bk627.LH21I0KeUC6s6IPDiFTXL31UaqY8BVhwFQNagdkpoKg +#HttpOnly_localhost FALSE / FALSE 1755175240 connect.sid s%3AeEPGIwIyDfv0Lv1yl_mNnpvEfiTbtG2U.fIbC09urP9gGafY%2BLayxvJMSElehNNST%2BPA9zJDe%2Bx8 diff --git a/server/storage.ts b/server/storage.ts index 5b1ec20..8e7313b 100644 --- a/server/storage.ts +++ b/server/storage.ts @@ -1816,6 +1816,14 @@ export class MemStorage implements IStorage { } } -// Use MemStorage in development, DatabaseStorage in production -const isProduction = process.env.NODE_ENV === 'production'; -export const storage: IStorage = isProduction ? new DatabaseStorage() : new MemStorage(); \ No newline at end of file +// FORCE: Use DatabaseStorage to see real production data +console.log('🔗 Database initialization:', { + NODE_ENV: process.env.NODE_ENV, + isProduction: process.env.NODE_ENV === 'production', + hasDbUrl: !!process.env.DATABASE_URL, + dbHost: process.env.DATABASE_URL?.split('@')[1]?.split('/')[0] || 'unknown' +}); + +// Force DatabaseStorage for real data access +export const storage: IStorage = new DatabaseStorage(); +console.log('✅ Using DatabaseStorage (real PostgreSQL data)'); \ No newline at end of file