Fix jwt-token
This commit is contained in:
@@ -26,6 +26,7 @@ const Heartbeat = require('./Heartbeat')(sequelize);
|
||||
const User = require('./User')(sequelize);
|
||||
const AlertRule = require('./AlertRule')(sequelize);
|
||||
const AlertLog = require('./AlertLog')(sequelize);
|
||||
const Tenant = require('./Tenant')(sequelize);
|
||||
|
||||
// Define associations
|
||||
Device.hasMany(DroneDetection, { foreignKey: 'device_id', as: 'detections' });
|
||||
@@ -43,6 +44,10 @@ AlertLog.belongsTo(AlertRule, { foreignKey: 'alert_rule_id', as: 'rule' });
|
||||
DroneDetection.hasMany(AlertLog, { foreignKey: 'detection_id', as: 'alerts' });
|
||||
AlertLog.belongsTo(DroneDetection, { foreignKey: 'detection_id', as: 'detection' });
|
||||
|
||||
// Tenant associations
|
||||
Tenant.hasMany(User, { foreignKey: 'tenant_id', as: 'users' });
|
||||
User.belongsTo(Tenant, { foreignKey: 'tenant_id', as: 'tenant' });
|
||||
|
||||
module.exports = {
|
||||
sequelize,
|
||||
Device,
|
||||
@@ -50,5 +55,6 @@ module.exports = {
|
||||
Heartbeat,
|
||||
User,
|
||||
AlertRule,
|
||||
AlertLog
|
||||
AlertLog,
|
||||
Tenant
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user