Fix jwt-token

This commit is contained in:
2025-08-17 06:07:50 +02:00
parent c38336fe9a
commit ad27485ef0
2 changed files with 6 additions and 3 deletions

View File

@@ -80,7 +80,7 @@ async function startServer() {
// Always sync database in containerized environments or development // Always sync database in containerized environments or development
// Check if tables exist before syncing // Check if tables exist before syncing
try { try {
await sequelize.sync({ alter: true }); await sequelize.sync({ force: false, alter: false });
console.log('Database synchronized.'); console.log('Database synchronized.');
// Seed database with initial data // Seed database with initial data
@@ -89,7 +89,7 @@ async function startServer() {
console.error('Database sync error:', syncError); console.error('Database sync error:', syncError);
// If sync fails, try force sync (this will drop and recreate tables) // If sync fails, try force sync (this will drop and recreate tables)
console.log('Attempting force sync...'); console.log('Attempting force sync...');
await sequelize.sync({ force: false, alter: true }); await sequelize.sync({ force: true });
console.log('Database force synchronized.'); console.log('Database force synchronized.');
// Seed database with initial data // Seed database with initial data

View File

@@ -74,8 +74,11 @@ module.exports = (sequelize) => {
comment: 'Whether this detection has been processed for alerts' comment: 'Whether this detection has been processed for alerts'
}, },
threat_level: { threat_level: {
type: DataTypes.ENUM('monitoring', 'low', 'medium', 'high', 'critical'), type: DataTypes.STRING,
allowNull: true, allowNull: true,
validate: {
isIn: [['monitoring', 'low', 'medium', 'high', 'critical']]
},
comment: 'Assessed threat level based on RSSI and drone type' comment: 'Assessed threat level based on RSSI and drone type'
}, },
estimated_distance: { estimated_distance: {