Fix critical production issue with missing SAV ticket data and add emergency recovery

Implement an automatic migration script and an emergency API route to resolve missing columns in the SAV production database, ensuring data integrity and system stability.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 31f9bd88-0285-4787-81b3-31ceeea5a08b
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/31f9bd88-0285-4787-81b3-31ceeea5a08b/nCX75tE
This commit is contained in:
michaelschal committed 2025-08-14 09:33:19 +00:00
1 parent a4e02d2fd1
commit 27ae1a836f
5 files changed
+305 -28

No files matched your search

+8 -3
View File
@@ -40,11 +40,16 @@ pool.on('error', (err) => {
// Run migrations automatically when database is configured
(async () => {
try {
console.log('🔄 Running automatic database migrations...');
console.log('🔄 DB: Running automatic database migrations...');
await runProductionMigrations();
console.log('✅ Database migrations completed');
console.log('✅ DB: Database migrations completed successfully');
} catch (error) {
console.error('❌ Database migrations failed:', error);
console.error('❌ DB: Database migrations failed with error:', error);
console.error('❌ DB: Migration failure details:', {
name: error?.name,
message: error?.message,
code: error?.code
});
// Don't fail the application startup for migration errors
}
})();