feat: add database test safety configuration
This commit is contained in:
@@ -7,8 +7,18 @@
|
||||
|
||||
const { execSync } = require('child_process');
|
||||
|
||||
// Database connection string
|
||||
const DB_URL = 'postgresql://euchre_camp:LINGO5row_hiding@dhg.lol:5432/euchre_camp';
|
||||
// Database connection string - use environment variable or default to production
|
||||
const DB_URL = process.env.PROD_DATABASE_URL ||
|
||||
process.env.DATABASE_URL ||
|
||||
'postgresql://euchre_camp:LINGO5row_hiding@dhg.lol:5432/euchre_camp';
|
||||
|
||||
// Validate that we're not accidentally using dev database
|
||||
if (DB_URL.includes('_dev') || DB_URL.includes('_dev_')) {
|
||||
console.error('❌ ERROR: This script should not be used with the development database!');
|
||||
console.error(' Current DATABASE_URL:', DB_URL);
|
||||
console.error(' Please set PROD_DATABASE_URL for production database operations.');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
// Helper to run SQL and log results
|
||||
function runSQL(sql, description) {
|
||||
|
||||
Reference in New Issue
Block a user