Fix jwt-token
This commit is contained in:
@@ -2,30 +2,46 @@
|
||||
|
||||
module.exports = {
|
||||
async up(queryInterface, Sequelize) {
|
||||
// Add raw_payload column to drone_detections table
|
||||
await queryInterface.addColumn('drone_detections', 'raw_payload', {
|
||||
type: Sequelize.JSON,
|
||||
allowNull: true,
|
||||
comment: 'Complete raw payload received from detector (for debugging)'
|
||||
});
|
||||
// Check if raw_payload column exists in drone_detections before adding
|
||||
const droneDetectionsTable = await queryInterface.describeTable('drone_detections');
|
||||
if (!droneDetectionsTable.raw_payload) {
|
||||
await queryInterface.addColumn('drone_detections', 'raw_payload', {
|
||||
type: Sequelize.JSON,
|
||||
allowNull: true,
|
||||
comment: 'Complete raw payload received from detector (for debugging)'
|
||||
});
|
||||
console.log('✅ Added raw_payload field to drone_detections table');
|
||||
} else {
|
||||
console.log('⏭️ raw_payload field already exists in drone_detections table');
|
||||
}
|
||||
|
||||
// Add raw_payload column to heartbeats table
|
||||
await queryInterface.addColumn('heartbeats', 'raw_payload', {
|
||||
type: Sequelize.JSON,
|
||||
allowNull: true,
|
||||
comment: 'Complete raw payload received from detector (for debugging)'
|
||||
});
|
||||
|
||||
console.log('✅ Added raw_payload fields to drone_detections and heartbeats tables');
|
||||
// Check if raw_payload column exists in heartbeats before adding
|
||||
const heartbeatsTable = await queryInterface.describeTable('heartbeats');
|
||||
if (!heartbeatsTable.raw_payload) {
|
||||
await queryInterface.addColumn('heartbeats', 'raw_payload', {
|
||||
type: Sequelize.JSON,
|
||||
allowNull: true,
|
||||
comment: 'Complete raw payload received from detector (for debugging)'
|
||||
});
|
||||
console.log('✅ Added raw_payload field to heartbeats table');
|
||||
} else {
|
||||
console.log('⏭️ raw_payload field already exists in heartbeats table');
|
||||
}
|
||||
},
|
||||
|
||||
async down(queryInterface, Sequelize) {
|
||||
// Remove raw_payload column from drone_detections table
|
||||
await queryInterface.removeColumn('drone_detections', 'raw_payload');
|
||||
const droneDetectionsTable = await queryInterface.describeTable('drone_detections');
|
||||
if (droneDetectionsTable.raw_payload) {
|
||||
await queryInterface.removeColumn('drone_detections', 'raw_payload');
|
||||
console.log('✅ Removed raw_payload field from drone_detections table');
|
||||
}
|
||||
|
||||
// Remove raw_payload column from heartbeats table
|
||||
await queryInterface.removeColumn('heartbeats', 'raw_payload');
|
||||
|
||||
console.log('✅ Removed raw_payload fields from drone_detections and heartbeats tables');
|
||||
const heartbeatsTable = await queryInterface.describeTable('heartbeats');
|
||||
if (heartbeatsTable.raw_payload) {
|
||||
await queryInterface.removeColumn('heartbeats', 'raw_payload');
|
||||
console.log('✅ Removed raw_payload field from heartbeats table');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user