Fix jwt-token
This commit is contained in:
@@ -7,8 +7,16 @@
|
|||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
async up(queryInterface, Sequelize) {
|
async up(queryInterface, Sequelize) {
|
||||||
// Check if tenant_id column already exists
|
try {
|
||||||
const tableDescription = await queryInterface.describeTable('devices');
|
// 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 tenant support migration...');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if tenant_id column already exists
|
||||||
|
const tableDescription = await queryInterface.describeTable('devices');
|
||||||
|
|
||||||
if (!tableDescription.tenant_id) {
|
if (!tableDescription.tenant_id) {
|
||||||
// Add tenant_id column to devices table
|
// Add tenant_id column to devices table
|
||||||
|
|||||||
Reference in New Issue
Block a user