Fix jwt-token
This commit is contained in:
@@ -168,7 +168,12 @@ module.exports = {
|
||||
}
|
||||
|
||||
// Add tenant-related columns to users table (idempotent)
|
||||
const usersTableDescription = await queryInterface.describeTable('users');
|
||||
const tables = await queryInterface.showAllTables();
|
||||
|
||||
if (!tables.includes('users')) {
|
||||
console.log('⚠️ Users table does not exist yet, skipping user tenant columns migration...');
|
||||
} else {
|
||||
const usersTableDescription = await queryInterface.describeTable('users');
|
||||
|
||||
if (!usersTableDescription.tenant_id) {
|
||||
await queryInterface.addColumn('users', 'tenant_id', {
|
||||
@@ -318,6 +323,8 @@ module.exports = {
|
||||
} catch (error) {
|
||||
console.log('Alert_rules table not found or already has tenant_id column');
|
||||
}
|
||||
|
||||
} // Close the else block for users table check
|
||||
|
||||
console.log('✅ Multi-tenant support added successfully');
|
||||
console.log('✅ Default tenant created for backward compatibility');
|
||||
|
||||
Reference in New Issue
Block a user