-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathverify_migration.js
More file actions
28 lines (24 loc) Β· 944 Bytes
/
verify_migration.js
File metadata and controls
28 lines (24 loc) Β· 944 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
const path = require('path');
require('dotenv').config({ path: path.join(__dirname, 'investbrand/backend/.env') });
const { initializePool } = require(path.join(__dirname, 'investbrand/backend/src/config/database'));
async function verifyMigration() {
try {
console.log('Starting migration verification...');
console.log('DB_NAME:', process.env.DB_NAME);
const pool = await initializePool();
console.log('Migration finished successfully.');
// Check constraints
const res = await pool.query(`
SELECT conname, pg_get_constraintdef(oid)
FROM pg_constraint
WHERE conrelid = 'puzzle_votes'::regclass;
`);
console.log('Current constraints for puzzle_votes:');
console.table(res.rows);
await pool.end();
} catch (err) {
console.error('Migration verification failed:', err.message);
process.exit(1);
}
}
verifyMigration();