- Add hardware fingerprinting with cross-platform support - Implement secure device registration flow with X.509 certificates - Add WebSocket real-time communication for device status - Create comprehensive device management dashboard - Establish zero-trust security architecture with multi-layer protection - Add database migrations for device registration entities - Implement Rust edge client with hardware identification - Add certificate management and automated provisioning system 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
50 lines
1.3 KiB
JavaScript
50 lines
1.3 KiB
JavaScript
const { Client } = require('pg');
|
|
|
|
async function checkMigrations() {
|
|
const client = new Client({
|
|
connectionString: 'postgresql://rabbit:g39j90p11@10.85.92.236:5433/dev'
|
|
});
|
|
|
|
try {
|
|
await client.connect();
|
|
console.log('Connected to database');
|
|
|
|
// Check existing migrations
|
|
const result = await client.query(
|
|
'SELECT * FROM pgmigrations ORDER BY run_on'
|
|
);
|
|
|
|
console.log('Existing migrations:');
|
|
result.rows.forEach(row => console.log(` - ${row.name} (run on ${row.run_on})`));
|
|
|
|
// Mark missing migrations as complete
|
|
const migrations = [
|
|
'1754714100000_create-camera-management-tables',
|
|
'1754714200000_create-weather-tables',
|
|
'1754714300000_create-subscription-tables',
|
|
'1755011659504_add-missing-device-columns'
|
|
];
|
|
|
|
for (const migration of migrations) {
|
|
const exists = result.rows.some(row => row.name === migration);
|
|
if (\!exists) {
|
|
await client.query(
|
|
'INSERT INTO pgmigrations (name, run_on) VALUES ($1, NOW())',
|
|
[migration]
|
|
);
|
|
console.log(`Added migration ${migration}`);
|
|
} else {
|
|
console.log(`Migration ${migration} already exists`);
|
|
}
|
|
}
|
|
|
|
} catch (error) {
|
|
console.error('Error:', error);
|
|
} finally {
|
|
await client.end();
|
|
console.log('Disconnected from database');
|
|
}
|
|
}
|
|
|
|
checkMigrations();
|