- 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>
72 lines
1.7 KiB
JavaScript
72 lines
1.7 KiB
JavaScript
/**
|
|
* @type {import('node-pg-migrate').ColumnDefinitions | undefined}
|
|
*/
|
|
export const shorthands = undefined;
|
|
|
|
/**
|
|
* @param pgm {import('node-pg-migrate').MigrationBuilder}
|
|
* @param run {() => void | undefined}
|
|
* @returns {Promise<void> | void}
|
|
*/
|
|
export const up = (pgm) => {
|
|
// Add missing columns to device_registrations table
|
|
|
|
// Add network_info column
|
|
pgm.addColumn('device_registrations', {
|
|
network_info: {
|
|
type: 'jsonb',
|
|
notNull: false,
|
|
},
|
|
});
|
|
|
|
// Add failed_at column
|
|
pgm.addColumn('device_registrations', {
|
|
failed_at: {
|
|
type: 'timestamptz',
|
|
notNull: false,
|
|
},
|
|
});
|
|
|
|
// Add failure_reason column
|
|
pgm.addColumn('device_registrations', {
|
|
failure_reason: {
|
|
type: 'text',
|
|
notNull: false,
|
|
},
|
|
});
|
|
|
|
// Add retry_count column
|
|
pgm.addColumn('device_registrations', {
|
|
retry_count: {
|
|
type: 'integer',
|
|
notNull: true,
|
|
default: 0,
|
|
},
|
|
});
|
|
|
|
// Add challenge_data column
|
|
pgm.addColumn('device_registrations', {
|
|
challenge_data: {
|
|
type: 'jsonb',
|
|
notNull: false,
|
|
},
|
|
});
|
|
|
|
console.log('Added missing columns to device_registrations table');
|
|
};
|
|
|
|
/**
|
|
* @param pgm {import('node-pg-migrate').MigrationBuilder}
|
|
* @param run {() => void | undefined}
|
|
* @returns {Promise<void> | void}
|
|
*/
|
|
export const down = (pgm) => {
|
|
// Remove the columns we added
|
|
pgm.dropColumn('device_registrations', 'network_info');
|
|
pgm.dropColumn('device_registrations', 'failed_at');
|
|
pgm.dropColumn('device_registrations', 'failure_reason');
|
|
pgm.dropColumn('device_registrations', 'retry_count');
|
|
pgm.dropColumn('device_registrations', 'challenge_data');
|
|
|
|
console.log('Removed added columns from device_registrations table');
|
|
}; |