Fix jwt-token

This commit is contained in:
2025-09-17 06:33:03 +02:00
parent 5e230b996b
commit 7cc24c0a5d

View File

@@ -7,6 +7,14 @@
module.exports = { module.exports = {
async up(queryInterface, Sequelize) { async up(queryInterface, Sequelize) {
try {
// Check if devices table exists first
const tables = await queryInterface.showAllTables();
if (!tables.includes('devices')) {
console.log('⚠️ Devices table does not exist yet, skipping device approval migration...');
return;
}
// Check if is_approved column already exists // Check if is_approved column already exists
const tableDescription = await queryInterface.describeTable('devices'); const tableDescription = await queryInterface.describeTable('devices');
@@ -34,6 +42,10 @@ module.exports = {
} else { } else {
console.log('⚠️ Column is_approved already exists, skipping...'); console.log('⚠️ Column is_approved already exists, skipping...');
} }
} catch (error) {
console.log('⚠️ Migration skipped - tables may not exist yet:', error.message);
// Don't throw error, just skip this migration if tables don't exist
}
}, },
async down(queryInterface, Sequelize) { async down(queryInterface, Sequelize) {