module.exports = {
    /**
     * @param {QueryInterface} queryInterface
     * @param {Sequelize} Sequelize
     * @returns {Promise<void>}
     */
    async up(queryInterface, Sequelize) {
        /**
         * @type {Transaction}
         */
        const transaction = await queryInterface.sequelize.transaction();
        try {
            
                
                    await queryInterface.createTable('users', {
                        id: {
                            type: Sequelize.DataTypes.UUID,
                            defaultValue: Sequelize.DataTypes.UUIDV4,
                            primaryKey: true,
                        },
                        createdById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        updatedById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        createdAt: { type: Sequelize.DataTypes.DATE },
                        updatedAt: { type: Sequelize.DataTypes.DATE },
                        deletedAt: { type: Sequelize.DataTypes.DATE },
                        importHash: {
                            type: Sequelize.DataTypes.STRING(255),
                            allowNull: true,
                          unique: true, 
                        },
                    }, { transaction });
                
            
                
                    await queryInterface.createTable('roles', {
                        id: {
                            type: Sequelize.DataTypes.UUID,
                            defaultValue: Sequelize.DataTypes.UUIDV4,
                            primaryKey: true,
                        },
                        createdById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        updatedById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        createdAt: { type: Sequelize.DataTypes.DATE },
                        updatedAt: { type: Sequelize.DataTypes.DATE },
                        deletedAt: { type: Sequelize.DataTypes.DATE },
                        importHash: {
                            type: Sequelize.DataTypes.STRING(255),
                            allowNull: true,
                          unique: true, 
                        },
                    }, { transaction });
                
            
                
                    await queryInterface.createTable('permissions', {
                        id: {
                            type: Sequelize.DataTypes.UUID,
                            defaultValue: Sequelize.DataTypes.UUIDV4,
                            primaryKey: true,
                        },
                        createdById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        updatedById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        createdAt: { type: Sequelize.DataTypes.DATE },
                        updatedAt: { type: Sequelize.DataTypes.DATE },
                        deletedAt: { type: Sequelize.DataTypes.DATE },
                        importHash: {
                            type: Sequelize.DataTypes.STRING(255),
                            allowNull: true,
                          unique: true, 
                        },
                    }, { transaction });
                
            
                
                    await queryInterface.createTable('organizations', {
                        id: {
                            type: Sequelize.DataTypes.UUID,
                            defaultValue: Sequelize.DataTypes.UUIDV4,
                            primaryKey: true,
                        },
                        createdById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        updatedById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        createdAt: { type: Sequelize.DataTypes.DATE },
                        updatedAt: { type: Sequelize.DataTypes.DATE },
                        deletedAt: { type: Sequelize.DataTypes.DATE },
                        importHash: {
                            type: Sequelize.DataTypes.STRING(255),
                            allowNull: true,
                          unique: true, 
                        },
                    }, { transaction });
                
            
                
                    await queryInterface.createTable('tenants', {
                        id: {
                            type: Sequelize.DataTypes.UUID,
                            defaultValue: Sequelize.DataTypes.UUIDV4,
                            primaryKey: true,
                        },
                        createdById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        updatedById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        createdAt: { type: Sequelize.DataTypes.DATE },
                        updatedAt: { type: Sequelize.DataTypes.DATE },
                        deletedAt: { type: Sequelize.DataTypes.DATE },
                        importHash: {
                            type: Sequelize.DataTypes.STRING(255),
                            allowNull: true,
                          unique: true, 
                        },
                    }, { transaction });
                
            
                
                    await queryInterface.createTable('role_assignments', {
                        id: {
                            type: Sequelize.DataTypes.UUID,
                            defaultValue: Sequelize.DataTypes.UUIDV4,
                            primaryKey: true,
                        },
                        createdById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        updatedById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        createdAt: { type: Sequelize.DataTypes.DATE },
                        updatedAt: { type: Sequelize.DataTypes.DATE },
                        deletedAt: { type: Sequelize.DataTypes.DATE },
                        importHash: {
                            type: Sequelize.DataTypes.STRING(255),
                            allowNull: true,
                          unique: true, 
                        },
                    }, { transaction });
                
            
                
                    await queryInterface.createTable('organization_memberships', {
                        id: {
                            type: Sequelize.DataTypes.UUID,
                            defaultValue: Sequelize.DataTypes.UUIDV4,
                            primaryKey: true,
                        },
                        createdById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        updatedById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        createdAt: { type: Sequelize.DataTypes.DATE },
                        updatedAt: { type: Sequelize.DataTypes.DATE },
                        deletedAt: { type: Sequelize.DataTypes.DATE },
                        importHash: {
                            type: Sequelize.DataTypes.STRING(255),
                            allowNull: true,
                          unique: true, 
                        },
                    }, { transaction });
                
            
                
                    await queryInterface.createTable('properties', {
                        id: {
                            type: Sequelize.DataTypes.UUID,
                            defaultValue: Sequelize.DataTypes.UUIDV4,
                            primaryKey: true,
                        },
                        createdById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        updatedById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        createdAt: { type: Sequelize.DataTypes.DATE },
                        updatedAt: { type: Sequelize.DataTypes.DATE },
                        deletedAt: { type: Sequelize.DataTypes.DATE },
                        importHash: {
                            type: Sequelize.DataTypes.STRING(255),
                            allowNull: true,
                          unique: true, 
                        },
                    }, { transaction });
                
            
                
                    await queryInterface.createTable('amenities', {
                        id: {
                            type: Sequelize.DataTypes.UUID,
                            defaultValue: Sequelize.DataTypes.UUIDV4,
                            primaryKey: true,
                        },
                        createdById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        updatedById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        createdAt: { type: Sequelize.DataTypes.DATE },
                        updatedAt: { type: Sequelize.DataTypes.DATE },
                        deletedAt: { type: Sequelize.DataTypes.DATE },
                        importHash: {
                            type: Sequelize.DataTypes.STRING(255),
                            allowNull: true,
                          unique: true, 
                        },
                    }, { transaction });
                
            
                
                    await queryInterface.createTable('unit_types', {
                        id: {
                            type: Sequelize.DataTypes.UUID,
                            defaultValue: Sequelize.DataTypes.UUIDV4,
                            primaryKey: true,
                        },
                        createdById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        updatedById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        createdAt: { type: Sequelize.DataTypes.DATE },
                        updatedAt: { type: Sequelize.DataTypes.DATE },
                        deletedAt: { type: Sequelize.DataTypes.DATE },
                        importHash: {
                            type: Sequelize.DataTypes.STRING(255),
                            allowNull: true,
                          unique: true, 
                        },
                    }, { transaction });
                
            
                
                    await queryInterface.createTable('units', {
                        id: {
                            type: Sequelize.DataTypes.UUID,
                            defaultValue: Sequelize.DataTypes.UUIDV4,
                            primaryKey: true,
                        },
                        createdById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        updatedById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        createdAt: { type: Sequelize.DataTypes.DATE },
                        updatedAt: { type: Sequelize.DataTypes.DATE },
                        deletedAt: { type: Sequelize.DataTypes.DATE },
                        importHash: {
                            type: Sequelize.DataTypes.STRING(255),
                            allowNull: true,
                          unique: true, 
                        },
                    }, { transaction });
                
            
                
                    await queryInterface.createTable('unit_availability_blocks', {
                        id: {
                            type: Sequelize.DataTypes.UUID,
                            defaultValue: Sequelize.DataTypes.UUIDV4,
                            primaryKey: true,
                        },
                        createdById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        updatedById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        createdAt: { type: Sequelize.DataTypes.DATE },
                        updatedAt: { type: Sequelize.DataTypes.DATE },
                        deletedAt: { type: Sequelize.DataTypes.DATE },
                        importHash: {
                            type: Sequelize.DataTypes.STRING(255),
                            allowNull: true,
                          unique: true, 
                        },
                    }, { transaction });
                
            
                
                    await queryInterface.createTable('negotiated_rates', {
                        id: {
                            type: Sequelize.DataTypes.UUID,
                            defaultValue: Sequelize.DataTypes.UUIDV4,
                            primaryKey: true,
                        },
                        createdById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        updatedById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        createdAt: { type: Sequelize.DataTypes.DATE },
                        updatedAt: { type: Sequelize.DataTypes.DATE },
                        deletedAt: { type: Sequelize.DataTypes.DATE },
                        importHash: {
                            type: Sequelize.DataTypes.STRING(255),
                            allowNull: true,
                          unique: true, 
                        },
                    }, { transaction });
                
            
                
                    await queryInterface.createTable('booking_requests', {
                        id: {
                            type: Sequelize.DataTypes.UUID,
                            defaultValue: Sequelize.DataTypes.UUIDV4,
                            primaryKey: true,
                        },
                        createdById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        updatedById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        createdAt: { type: Sequelize.DataTypes.DATE },
                        updatedAt: { type: Sequelize.DataTypes.DATE },
                        deletedAt: { type: Sequelize.DataTypes.DATE },
                        importHash: {
                            type: Sequelize.DataTypes.STRING(255),
                            allowNull: true,
                          unique: true, 
                        },
                    }, { transaction });
                
            
                
                    await queryInterface.createTable('booking_request_travelers', {
                        id: {
                            type: Sequelize.DataTypes.UUID,
                            defaultValue: Sequelize.DataTypes.UUIDV4,
                            primaryKey: true,
                        },
                        createdById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        updatedById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        createdAt: { type: Sequelize.DataTypes.DATE },
                        updatedAt: { type: Sequelize.DataTypes.DATE },
                        deletedAt: { type: Sequelize.DataTypes.DATE },
                        importHash: {
                            type: Sequelize.DataTypes.STRING(255),
                            allowNull: true,
                          unique: true, 
                        },
                    }, { transaction });
                
            
                
                    await queryInterface.createTable('approval_steps', {
                        id: {
                            type: Sequelize.DataTypes.UUID,
                            defaultValue: Sequelize.DataTypes.UUIDV4,
                            primaryKey: true,
                        },
                        createdById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        updatedById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        createdAt: { type: Sequelize.DataTypes.DATE },
                        updatedAt: { type: Sequelize.DataTypes.DATE },
                        deletedAt: { type: Sequelize.DataTypes.DATE },
                        importHash: {
                            type: Sequelize.DataTypes.STRING(255),
                            allowNull: true,
                          unique: true, 
                        },
                    }, { transaction });
                
            
                
                    await queryInterface.createTable('reservations', {
                        id: {
                            type: Sequelize.DataTypes.UUID,
                            defaultValue: Sequelize.DataTypes.UUIDV4,
                            primaryKey: true,
                        },
                        createdById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        updatedById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        createdAt: { type: Sequelize.DataTypes.DATE },
                        updatedAt: { type: Sequelize.DataTypes.DATE },
                        deletedAt: { type: Sequelize.DataTypes.DATE },
                        importHash: {
                            type: Sequelize.DataTypes.STRING(255),
                            allowNull: true,
                          unique: true, 
                        },
                    }, { transaction });
                
            
                
                    await queryInterface.createTable('reservation_guests', {
                        id: {
                            type: Sequelize.DataTypes.UUID,
                            defaultValue: Sequelize.DataTypes.UUIDV4,
                            primaryKey: true,
                        },
                        createdById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        updatedById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        createdAt: { type: Sequelize.DataTypes.DATE },
                        updatedAt: { type: Sequelize.DataTypes.DATE },
                        deletedAt: { type: Sequelize.DataTypes.DATE },
                        importHash: {
                            type: Sequelize.DataTypes.STRING(255),
                            allowNull: true,
                          unique: true, 
                        },
                    }, { transaction });
                
            
                
                    await queryInterface.createTable('service_requests', {
                        id: {
                            type: Sequelize.DataTypes.UUID,
                            defaultValue: Sequelize.DataTypes.UUIDV4,
                            primaryKey: true,
                        },
                        createdById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        updatedById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        createdAt: { type: Sequelize.DataTypes.DATE },
                        updatedAt: { type: Sequelize.DataTypes.DATE },
                        deletedAt: { type: Sequelize.DataTypes.DATE },
                        importHash: {
                            type: Sequelize.DataTypes.STRING(255),
                            allowNull: true,
                          unique: true, 
                        },
                    }, { transaction });
                
            
                
                    await queryInterface.createTable('invoices', {
                        id: {
                            type: Sequelize.DataTypes.UUID,
                            defaultValue: Sequelize.DataTypes.UUIDV4,
                            primaryKey: true,
                        },
                        createdById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        updatedById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        createdAt: { type: Sequelize.DataTypes.DATE },
                        updatedAt: { type: Sequelize.DataTypes.DATE },
                        deletedAt: { type: Sequelize.DataTypes.DATE },
                        importHash: {
                            type: Sequelize.DataTypes.STRING(255),
                            allowNull: true,
                          unique: true, 
                        },
                    }, { transaction });
                
            
                
                    await queryInterface.createTable('invoice_line_items', {
                        id: {
                            type: Sequelize.DataTypes.UUID,
                            defaultValue: Sequelize.DataTypes.UUIDV4,
                            primaryKey: true,
                        },
                        createdById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        updatedById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        createdAt: { type: Sequelize.DataTypes.DATE },
                        updatedAt: { type: Sequelize.DataTypes.DATE },
                        deletedAt: { type: Sequelize.DataTypes.DATE },
                        importHash: {
                            type: Sequelize.DataTypes.STRING(255),
                            allowNull: true,
                          unique: true, 
                        },
                    }, { transaction });
                
            
                
                    await queryInterface.createTable('payments', {
                        id: {
                            type: Sequelize.DataTypes.UUID,
                            defaultValue: Sequelize.DataTypes.UUIDV4,
                            primaryKey: true,
                        },
                        createdById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        updatedById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        createdAt: { type: Sequelize.DataTypes.DATE },
                        updatedAt: { type: Sequelize.DataTypes.DATE },
                        deletedAt: { type: Sequelize.DataTypes.DATE },
                        importHash: {
                            type: Sequelize.DataTypes.STRING(255),
                            allowNull: true,
                          unique: true, 
                        },
                    }, { transaction });
                
            
                
                    await queryInterface.createTable('documents', {
                        id: {
                            type: Sequelize.DataTypes.UUID,
                            defaultValue: Sequelize.DataTypes.UUIDV4,
                            primaryKey: true,
                        },
                        createdById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        updatedById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        createdAt: { type: Sequelize.DataTypes.DATE },
                        updatedAt: { type: Sequelize.DataTypes.DATE },
                        deletedAt: { type: Sequelize.DataTypes.DATE },
                        importHash: {
                            type: Sequelize.DataTypes.STRING(255),
                            allowNull: true,
                          unique: true, 
                        },
                    }, { transaction });
                
            
                
                    await queryInterface.createTable('audit_logs', {
                        id: {
                            type: Sequelize.DataTypes.UUID,
                            defaultValue: Sequelize.DataTypes.UUIDV4,
                            primaryKey: true,
                        },
                        createdById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        updatedById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        createdAt: { type: Sequelize.DataTypes.DATE },
                        updatedAt: { type: Sequelize.DataTypes.DATE },
                        deletedAt: { type: Sequelize.DataTypes.DATE },
                        importHash: {
                            type: Sequelize.DataTypes.STRING(255),
                            allowNull: true,
                          unique: true, 
                        },
                    }, { transaction });
                
            
                
                    await queryInterface.createTable('notifications', {
                        id: {
                            type: Sequelize.DataTypes.UUID,
                            defaultValue: Sequelize.DataTypes.UUIDV4,
                            primaryKey: true,
                        },
                        createdById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        updatedById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        createdAt: { type: Sequelize.DataTypes.DATE },
                        updatedAt: { type: Sequelize.DataTypes.DATE },
                        deletedAt: { type: Sequelize.DataTypes.DATE },
                        importHash: {
                            type: Sequelize.DataTypes.STRING(255),
                            allowNull: true,
                          unique: true, 
                        },
                    }, { transaction });
                
            
                
                    await queryInterface.createTable('activity_comments', {
                        id: {
                            type: Sequelize.DataTypes.UUID,
                            defaultValue: Sequelize.DataTypes.UUIDV4,
                            primaryKey: true,
                        },
                        createdById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        updatedById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        createdAt: { type: Sequelize.DataTypes.DATE },
                        updatedAt: { type: Sequelize.DataTypes.DATE },
                        deletedAt: { type: Sequelize.DataTypes.DATE },
                        importHash: {
                            type: Sequelize.DataTypes.STRING(255),
                            allowNull: true,
                          unique: true, 
                        },
                    }, { transaction });
                
            
                
                    await queryInterface.createTable('checklists', {
                        id: {
                            type: Sequelize.DataTypes.UUID,
                            defaultValue: Sequelize.DataTypes.UUIDV4,
                            primaryKey: true,
                        },
                        createdById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        updatedById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        createdAt: { type: Sequelize.DataTypes.DATE },
                        updatedAt: { type: Sequelize.DataTypes.DATE },
                        deletedAt: { type: Sequelize.DataTypes.DATE },
                        importHash: {
                            type: Sequelize.DataTypes.STRING(255),
                            allowNull: true,
                          unique: true, 
                        },
                    }, { transaction });
                
            
                
                    await queryInterface.createTable('checklist_items', {
                        id: {
                            type: Sequelize.DataTypes.UUID,
                            defaultValue: Sequelize.DataTypes.UUIDV4,
                            primaryKey: true,
                        },
                        createdById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        updatedById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        createdAt: { type: Sequelize.DataTypes.DATE },
                        updatedAt: { type: Sequelize.DataTypes.DATE },
                        deletedAt: { type: Sequelize.DataTypes.DATE },
                        importHash: {
                            type: Sequelize.DataTypes.STRING(255),
                            allowNull: true,
                          unique: true, 
                        },
                    }, { transaction });
                
            
                
                    await queryInterface.createTable('job_runs', {
                        id: {
                            type: Sequelize.DataTypes.UUID,
                            defaultValue: Sequelize.DataTypes.UUIDV4,
                            primaryKey: true,
                        },
                        createdById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        updatedById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        createdAt: { type: Sequelize.DataTypes.DATE },
                        updatedAt: { type: Sequelize.DataTypes.DATE },
                        deletedAt: { type: Sequelize.DataTypes.DATE },
                        importHash: {
                            type: Sequelize.DataTypes.STRING(255),
                            allowNull: true,
                          unique: true, 
                        },
                    }, { transaction });
                
            
                
                    
                    await queryInterface.addColumn(
                      'users',
                      'firstName',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'users',
                      'lastName',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'users',
                      'phoneNumber',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'users',
                      'email',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'users',
                      'disabled',
                      {
                          type: Sequelize.DataTypes.BOOLEAN,
                          
                            defaultValue: false,
                            allowNull: false,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
            
                
                    
                    await queryInterface.addColumn(
                      'users',
                      'password',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'users',
                      'emailVerified',
                      {
                          type: Sequelize.DataTypes.BOOLEAN,
                          
                            defaultValue: false,
                            allowNull: false,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'users',
                      'emailVerificationToken',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'users',
                      'emailVerificationTokenExpiresAt',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'users',
                      'passwordResetToken',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'users',
                      'passwordResetTokenExpiresAt',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'users',
                      'provider',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'users',
                      'app_roleId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'roles',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
            
                
                    
                    await queryInterface.addColumn(
                      'users',
                      'organizationsId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'organizations',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'roles',
                      'name',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'roles',
                      'role_customization',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
            
                
                    
                    await queryInterface.addColumn(
                      'roles',
                      'globalAccess',
                      {
                          type: Sequelize.DataTypes.BOOLEAN,
                          
                            defaultValue: false,
                            allowNull: false,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'permissions',
                      'name',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'organizations',
                      'name',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'tenants',
                      'name',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'tenants',
                      'slug',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'tenants',
                      'legal_name',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'tenants',
                      'primary_domain',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'tenants',
                      'timezone',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'tenants',
                      'default_currency',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'tenants',
                      'is_active',
                      {
                          type: Sequelize.DataTypes.BOOLEAN,
                          
                            defaultValue: false,
                            allowNull: false,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
            
                
            
                
            
                
                    
                    await queryInterface.addColumn(
                      'role_assignments',
                      'userId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'users',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'role_assignments',
                      'roleId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'roles',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'role_assignments',
                      'tenantId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'tenants',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'role_assignments',
                      'organizationId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'organizations',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'role_assignments',
                      'is_active',
                      {
                          type: Sequelize.DataTypes.BOOLEAN,
                          
                            defaultValue: false,
                            allowNull: false,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'role_assignments',
                      'effective_from',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'role_assignments',
                      'effective_until',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'organization_memberships',
                      'organizationId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'organizations',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'organization_memberships',
                      'userId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'users',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'organization_memberships',
                      'member_role',
                      {
                          type: Sequelize.DataTypes.ENUM,
                          
                          
                            values: ['corporate_admin','corporate_booker','approver','traveler','internal_reservations','internal_concierge','internal_finance','super_admin'],
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'organization_memberships',
                      'is_primary',
                      {
                          type: Sequelize.DataTypes.BOOLEAN,
                          
                            defaultValue: false,
                            allowNull: false,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'organization_memberships',
                      'is_active',
                      {
                          type: Sequelize.DataTypes.BOOLEAN,
                          
                            defaultValue: false,
                            allowNull: false,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'organization_memberships',
                      'job_title',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'organization_memberships',
                      'phone',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'properties',
                      'tenantId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'tenants',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'properties',
                      'name',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'properties',
                      'code',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'properties',
                      'address',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'properties',
                      'city',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'properties',
                      'country',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'properties',
                      'timezone',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'properties',
                      'description',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
            
                
                    
                    await queryInterface.addColumn(
                      'properties',
                      'is_active',
                      {
                          type: Sequelize.DataTypes.BOOLEAN,
                          
                            defaultValue: false,
                            allowNull: false,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
            
                
            
                
            
                
                    
                    await queryInterface.addColumn(
                      'properties',
                      'organizationsId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'organizations',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'amenities',
                      'propertyId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'properties',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'amenities',
                      'name',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'amenities',
                      'description',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'amenities',
                      'organizationsId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'organizations',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'unit_types',
                      'propertyId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'properties',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'unit_types',
                      'name',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'unit_types',
                      'code',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'unit_types',
                      'max_occupancy',
                      {
                          type: Sequelize.DataTypes.INTEGER,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'unit_types',
                      'bedrooms',
                      {
                          type: Sequelize.DataTypes.INTEGER,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'unit_types',
                      'bathrooms',
                      {
                          type: Sequelize.DataTypes.INTEGER,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'unit_types',
                      'size_sqm',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'unit_types',
                      'description',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'unit_types',
                      'base_nightly_rate',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'unit_types',
                      'base_monthly_rate',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'unit_types',
                      'minimum_stay_nights',
                      {
                          type: Sequelize.DataTypes.INTEGER,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
            
                
                    
                    await queryInterface.addColumn(
                      'unit_types',
                      'organizationsId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'organizations',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'units',
                      'propertyId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'properties',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'units',
                      'unit_typeId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'unit_types',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'units',
                      'unit_number',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'units',
                      'floor',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'units',
                      'status',
                      {
                          type: Sequelize.DataTypes.ENUM,
                          
                          
                            values: ['available','occupied','maintenance','cleaning_hold','reserved','out_of_service'],
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'units',
                      'max_occupancy_override',
                      {
                          type: Sequelize.DataTypes.INTEGER,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'units',
                      'notes',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
            
                
                    
                    await queryInterface.addColumn(
                      'units',
                      'organizationsId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'organizations',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'unit_availability_blocks',
                      'unitId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'units',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'unit_availability_blocks',
                      'block_type',
                      {
                          type: Sequelize.DataTypes.ENUM,
                          
                          
                            values: ['blackout','maintenance','owner_hold','reservation_hold'],
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'unit_availability_blocks',
                      'start_at',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'unit_availability_blocks',
                      'end_at',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'unit_availability_blocks',
                      'reason',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'unit_availability_blocks',
                      'reservationId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'reservations',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'unit_availability_blocks',
                      'organizationsId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'organizations',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'negotiated_rates',
                      'organizationId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'organizations',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'negotiated_rates',
                      'propertyId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'properties',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'negotiated_rates',
                      'unit_typeId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'unit_types',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'negotiated_rates',
                      'rate_type',
                      {
                          type: Sequelize.DataTypes.ENUM,
                          
                          
                            values: ['nightly','monthly'],
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'negotiated_rates',
                      'rate_amount',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'negotiated_rates',
                      'valid_from',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'negotiated_rates',
                      'valid_until',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'negotiated_rates',
                      'minimum_stay_nights',
                      {
                          type: Sequelize.DataTypes.INTEGER,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'negotiated_rates',
                      'is_active',
                      {
                          type: Sequelize.DataTypes.BOOLEAN,
                          
                            defaultValue: false,
                            allowNull: false,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'negotiated_rates',
                      'notes',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'booking_requests',
                      'tenantId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'tenants',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'booking_requests',
                      'organizationId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'organizations',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'booking_requests',
                      'requested_byId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'users',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'booking_requests',
                      'request_code',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'booking_requests',
                      'status',
                      {
                          type: Sequelize.DataTypes.ENUM,
                          
                          
                            values: ['draft','submitted','in_review','changes_requested','approved','rejected','expired','converted_to_reservation','canceled'],
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'booking_requests',
                      'check_in_at',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'booking_requests',
                      'check_out_at',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'booking_requests',
                      'preferred_propertyId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'properties',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'booking_requests',
                      'preferred_unit_typeId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'unit_types',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'booking_requests',
                      'preferred_bedrooms',
                      {
                          type: Sequelize.DataTypes.INTEGER,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'booking_requests',
                      'guest_count',
                      {
                          type: Sequelize.DataTypes.INTEGER,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'booking_requests',
                      'purpose_of_stay',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'booking_requests',
                      'special_requirements',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'booking_requests',
                      'budget_code',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'booking_requests',
                      'max_budget_amount',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'booking_requests',
                      'currency',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
            
                
            
                
            
                
            
                
                    
                    await queryInterface.addColumn(
                      'booking_request_travelers',
                      'booking_requestId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'booking_requests',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'booking_request_travelers',
                      'full_name',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'booking_request_travelers',
                      'email',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'booking_request_travelers',
                      'phone',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'booking_request_travelers',
                      'nationality',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'booking_request_travelers',
                      'passport_number',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'booking_request_travelers',
                      'date_of_birth',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'booking_request_travelers',
                      'primary_traveler',
                      {
                          type: Sequelize.DataTypes.BOOLEAN,
                          
                            defaultValue: false,
                            allowNull: false,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'booking_request_travelers',
                      'notes',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'booking_request_travelers',
                      'organizationsId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'organizations',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'approval_steps',
                      'booking_requestId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'booking_requests',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'approval_steps',
                      'step_order',
                      {
                          type: Sequelize.DataTypes.INTEGER,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'approval_steps',
                      'approverId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'users',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'approval_steps',
                      'decision',
                      {
                          type: Sequelize.DataTypes.ENUM,
                          
                          
                            values: ['pending','approved','rejected','changes_requested','skipped'],
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'approval_steps',
                      'decided_at',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'approval_steps',
                      'decision_notes',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'approval_steps',
                      'organizationsId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'organizations',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'reservations',
                      'tenantId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'tenants',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'reservations',
                      'organizationId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'organizations',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'reservations',
                      'booking_requestId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'booking_requests',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'reservations',
                      'reservation_code',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'reservations',
                      'status',
                      {
                          type: Sequelize.DataTypes.ENUM,
                          
                          
                            values: ['quoted','confirmed','checked_in','checked_out','canceled','no_show'],
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'reservations',
                      'propertyId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'properties',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'reservations',
                      'unitId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'units',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'reservations',
                      'unit_typeId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'unit_types',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'reservations',
                      'check_in_at',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'reservations',
                      'check_out_at',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'reservations',
                      'actual_check_in_at',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'reservations',
                      'actual_check_out_at',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'reservations',
                      'early_check_in',
                      {
                          type: Sequelize.DataTypes.BOOLEAN,
                          
                            defaultValue: false,
                            allowNull: false,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'reservations',
                      'late_check_out',
                      {
                          type: Sequelize.DataTypes.BOOLEAN,
                          
                            defaultValue: false,
                            allowNull: false,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'reservations',
                      'guest_count',
                      {
                          type: Sequelize.DataTypes.INTEGER,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'reservations',
                      'nightly_rate',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'reservations',
                      'monthly_rate',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'reservations',
                      'currency',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'reservations',
                      'internal_notes',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'reservations',
                      'external_notes',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
            
                
            
                
            
                
            
                
            
                
                    
                    await queryInterface.addColumn(
                      'reservation_guests',
                      'reservationId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'reservations',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'reservation_guests',
                      'full_name',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'reservation_guests',
                      'email',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'reservation_guests',
                      'phone',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'reservation_guests',
                      'guest_type',
                      {
                          type: Sequelize.DataTypes.ENUM,
                          
                          
                            values: ['traveler','additional_guest','vip','driver','security'],
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'reservation_guests',
                      'primary_guest',
                      {
                          type: Sequelize.DataTypes.BOOLEAN,
                          
                            defaultValue: false,
                            allowNull: false,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'reservation_guests',
                      'notes',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'reservation_guests',
                      'organizationsId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'organizations',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'service_requests',
                      'tenantId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'tenants',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'service_requests',
                      'reservationId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'reservations',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'service_requests',
                      'requested_byId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'users',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'service_requests',
                      'assigned_toId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'users',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'service_requests',
                      'request_type',
                      {
                          type: Sequelize.DataTypes.ENUM,
                          
                          
                            values: ['airport_pickup','housekeeping','maintenance','stocked_fridge','chauffeur','late_checkout','extension','custom_service'],
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'service_requests',
                      'status',
                      {
                          type: Sequelize.DataTypes.ENUM,
                          
                          
                            values: ['new','triaged','in_progress','scheduled','waiting_on_guest','completed','canceled'],
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'service_requests',
                      'priority',
                      {
                          type: Sequelize.DataTypes.ENUM,
                          
                          
                            values: ['low','normal','high','urgent'],
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'service_requests',
                      'requested_at',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'service_requests',
                      'due_at',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'service_requests',
                      'completed_at',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'service_requests',
                      'summary',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'service_requests',
                      'details',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'service_requests',
                      'estimated_cost',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'service_requests',
                      'actual_cost',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'service_requests',
                      'currency',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
            
                
            
                
                    
                    await queryInterface.addColumn(
                      'service_requests',
                      'organizationsId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'organizations',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'invoices',
                      'tenantId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'tenants',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'invoices',
                      'organizationId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'organizations',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'invoices',
                      'reservationId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'reservations',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'invoices',
                      'invoice_number',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'invoices',
                      'status',
                      {
                          type: Sequelize.DataTypes.ENUM,
                          
                          
                            values: ['draft','issued','overdue','paid','partially_paid','void'],
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'invoices',
                      'issued_at',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'invoices',
                      'due_at',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'invoices',
                      'subtotal_amount',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'invoices',
                      'tax_amount',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'invoices',
                      'total_amount',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'invoices',
                      'balance_due',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'invoices',
                      'currency',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'invoices',
                      'bill_to_name',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'invoices',
                      'bill_to_address',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'invoices',
                      'notes',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
            
                
            
                
            
                
            
                
                    
                    await queryInterface.addColumn(
                      'invoice_line_items',
                      'invoiceId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'invoices',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'invoice_line_items',
                      'line_type',
                      {
                          type: Sequelize.DataTypes.ENUM,
                          
                          
                            values: ['accommodation','transport','cleaning','add_on','damage','fee','discount','tax_adjustment'],
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'invoice_line_items',
                      'description',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'invoice_line_items',
                      'quantity',
                      {
                          type: Sequelize.DataTypes.INTEGER,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'invoice_line_items',
                      'unit_price',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'invoice_line_items',
                      'amount',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'invoice_line_items',
                      'service_period',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'invoice_line_items',
                      'organizationsId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'organizations',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'payments',
                      'invoiceId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'invoices',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'payments',
                      'payment_method',
                      {
                          type: Sequelize.DataTypes.ENUM,
                          
                          
                            values: ['bank_transfer','card','cash','check','credit_note','other'],
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'payments',
                      'status',
                      {
                          type: Sequelize.DataTypes.ENUM,
                          
                          
                            values: ['pending','completed','failed','reversed'],
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'payments',
                      'amount',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'payments',
                      'currency',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'payments',
                      'paid_at',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'payments',
                      'reference',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'payments',
                      'notes',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
            
                
                    
                    await queryInterface.addColumn(
                      'payments',
                      'organizationsId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'organizations',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'documents',
                      'tenantId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'tenants',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'documents',
                      'document_type',
                      {
                          type: Sequelize.DataTypes.ENUM,
                          
                          
                            values: ['invoice_pdf','guest_id','contract','approval_attachment','arrival_instructions','checklist','inspection_report','other'],
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'documents',
                      'file_name',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'documents',
                      'mime_type',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'documents',
                      'file_size_bytes',
                      {
                          type: Sequelize.DataTypes.INTEGER,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'documents',
                      'storage_key',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'documents',
                      'public_url',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'documents',
                      'uploaded_byId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'users',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'documents',
                      'organizationId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'organizations',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'documents',
                      'booking_requestId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'booking_requests',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'documents',
                      'reservationId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'reservations',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'documents',
                      'service_requestId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'service_requests',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'documents',
                      'invoiceId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'invoices',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'documents',
                      'notes',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'documents',
                      'is_private',
                      {
                          type: Sequelize.DataTypes.BOOLEAN,
                          
                            defaultValue: false,
                            allowNull: false,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'audit_logs',
                      'tenantId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'tenants',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'audit_logs',
                      'actorId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'users',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'audit_logs',
                      'action',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'audit_logs',
                      'entity_name',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'audit_logs',
                      'entity_reference',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'audit_logs',
                      'ip_address',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'audit_logs',
                      'user_agent',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'audit_logs',
                      'occurred_at',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'audit_logs',
                      'metadata_json',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'audit_logs',
                      'organizationsId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'organizations',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'notifications',
                      'tenantId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'tenants',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'notifications',
                      'userId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'users',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'notifications',
                      'channel',
                      {
                          type: Sequelize.DataTypes.ENUM,
                          
                          
                            values: ['in_app','email'],
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'notifications',
                      'type',
                      {
                          type: Sequelize.DataTypes.ENUM,
                          
                          
                            values: ['approval_required','approval_decision','reservation_confirmed','upcoming_check_in','upcoming_check_out','invoice_issued','invoice_overdue','service_request_update','comment_mention','system'],
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'notifications',
                      'title',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'notifications',
                      'body',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'notifications',
                      'link_url',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'notifications',
                      'sent_at',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'notifications',
                      'read_at',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'notifications',
                      'is_read',
                      {
                          type: Sequelize.DataTypes.BOOLEAN,
                          
                            defaultValue: false,
                            allowNull: false,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'notifications',
                      'organizationsId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'organizations',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'activity_comments',
                      'tenantId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'tenants',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'activity_comments',
                      'organizationId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'organizations',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'activity_comments',
                      'authorId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'users',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'activity_comments',
                      'visibility',
                      {
                          type: Sequelize.DataTypes.ENUM,
                          
                          
                            values: ['internal','external'],
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'activity_comments',
                      'body',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'activity_comments',
                      'posted_at',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'activity_comments',
                      'booking_requestId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'booking_requests',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'activity_comments',
                      'reservationId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'reservations',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'activity_comments',
                      'service_requestId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'service_requests',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'activity_comments',
                      'invoiceId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'invoices',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'checklists',
                      'tenantId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'tenants',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'checklists',
                      'reservationId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'reservations',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'checklists',
                      'checklist_type',
                      {
                          type: Sequelize.DataTypes.ENUM,
                          
                          
                            values: ['pre_arrival','check_in','check_out','turnover'],
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'checklists',
                      'status',
                      {
                          type: Sequelize.DataTypes.ENUM,
                          
                          
                            values: ['not_started','in_progress','completed','blocked'],
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'checklists',
                      'due_at',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'checklists',
                      'completed_at',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'checklists',
                      'assigned_toId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'users',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
            
                
                    
                    await queryInterface.addColumn(
                      'checklists',
                      'notes',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'checklists',
                      'organizationsId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'organizations',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'checklist_items',
                      'checklistId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'checklists',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'checklist_items',
                      'title',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'checklist_items',
                      'is_done',
                      {
                          type: Sequelize.DataTypes.BOOLEAN,
                          
                            defaultValue: false,
                            allowNull: false,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'checklist_items',
                      'done_at',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'checklist_items',
                      'done_byId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'users',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'checklist_items',
                      'sort_order',
                      {
                          type: Sequelize.DataTypes.INTEGER,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'checklist_items',
                      'notes',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'checklist_items',
                      'organizationsId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'organizations',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'job_runs',
                      'tenantId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'tenants',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'job_runs',
                      'job_type',
                      {
                          type: Sequelize.DataTypes.ENUM,
                          
                          
                            values: ['approval_reminder','upcoming_check_in_reminder','overdue_invoice_notice','upcoming_check_out_reminder','daily_digest','system_cleanup'],
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'job_runs',
                      'status',
                      {
                          type: Sequelize.DataTypes.ENUM,
                          
                          
                            values: ['queued','running','succeeded','failed','canceled'],
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'job_runs',
                      'scheduled_for',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'job_runs',
                      'started_at',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'job_runs',
                      'finished_at',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'job_runs',
                      'attempt_count',
                      {
                          type: Sequelize.DataTypes.INTEGER,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'job_runs',
                      'last_error',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'job_runs',
                      'payload_json',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'job_runs',
                      'organizationsId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'organizations',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
            
            
            await transaction.commit();
        } catch (err) {
            await transaction.rollback();
            throw err;
        }
    },
    /**
     * @param {QueryInterface} queryInterface
     * @param {Sequelize} Sequelize
     * @returns {Promise<void>}
     */
    async down(queryInterface, Sequelize) {
        /**
         * @type {Transaction}
         */
        const transaction = await queryInterface.sequelize.transaction();
        try {
            
                
                    await queryInterface.removeColumn(
                        'job_runs',
                        'organizationsId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'job_runs',
                        'payload_json',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'job_runs',
                        'last_error',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'job_runs',
                        'attempt_count',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'job_runs',
                        'finished_at',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'job_runs',
                        'started_at',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'job_runs',
                        'scheduled_for',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'job_runs',
                        'status',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'job_runs',
                        'job_type',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'job_runs',
                        'tenantId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'checklist_items',
                        'organizationsId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'checklist_items',
                        'notes',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'checklist_items',
                        'sort_order',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'checklist_items',
                        'done_byId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'checklist_items',
                        'done_at',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'checklist_items',
                        'is_done',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'checklist_items',
                        'title',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'checklist_items',
                        'checklistId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'checklists',
                        'organizationsId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'checklists',
                        'notes',
                        { transaction }
                    );
                
            
                
            
                
                    await queryInterface.removeColumn(
                        'checklists',
                        'assigned_toId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'checklists',
                        'completed_at',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'checklists',
                        'due_at',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'checklists',
                        'status',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'checklists',
                        'checklist_type',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'checklists',
                        'reservationId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'checklists',
                        'tenantId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'activity_comments',
                        'invoiceId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'activity_comments',
                        'service_requestId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'activity_comments',
                        'reservationId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'activity_comments',
                        'booking_requestId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'activity_comments',
                        'posted_at',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'activity_comments',
                        'body',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'activity_comments',
                        'visibility',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'activity_comments',
                        'authorId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'activity_comments',
                        'organizationId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'activity_comments',
                        'tenantId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'notifications',
                        'organizationsId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'notifications',
                        'is_read',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'notifications',
                        'read_at',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'notifications',
                        'sent_at',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'notifications',
                        'link_url',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'notifications',
                        'body',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'notifications',
                        'title',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'notifications',
                        'type',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'notifications',
                        'channel',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'notifications',
                        'userId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'notifications',
                        'tenantId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'audit_logs',
                        'organizationsId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'audit_logs',
                        'metadata_json',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'audit_logs',
                        'occurred_at',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'audit_logs',
                        'user_agent',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'audit_logs',
                        'ip_address',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'audit_logs',
                        'entity_reference',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'audit_logs',
                        'entity_name',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'audit_logs',
                        'action',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'audit_logs',
                        'actorId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'audit_logs',
                        'tenantId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'documents',
                        'is_private',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'documents',
                        'notes',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'documents',
                        'invoiceId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'documents',
                        'service_requestId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'documents',
                        'reservationId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'documents',
                        'booking_requestId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'documents',
                        'organizationId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'documents',
                        'uploaded_byId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'documents',
                        'public_url',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'documents',
                        'storage_key',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'documents',
                        'file_size_bytes',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'documents',
                        'mime_type',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'documents',
                        'file_name',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'documents',
                        'document_type',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'documents',
                        'tenantId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'payments',
                        'organizationsId',
                        { transaction }
                    );
                
            
                
            
                
                    await queryInterface.removeColumn(
                        'payments',
                        'notes',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'payments',
                        'reference',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'payments',
                        'paid_at',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'payments',
                        'currency',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'payments',
                        'amount',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'payments',
                        'status',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'payments',
                        'payment_method',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'payments',
                        'invoiceId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'invoice_line_items',
                        'organizationsId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'invoice_line_items',
                        'service_period',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'invoice_line_items',
                        'amount',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'invoice_line_items',
                        'unit_price',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'invoice_line_items',
                        'quantity',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'invoice_line_items',
                        'description',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'invoice_line_items',
                        'line_type',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'invoice_line_items',
                        'invoiceId',
                        { transaction }
                    );
                
            
                
            
                
            
                
            
                
            
                
                    await queryInterface.removeColumn(
                        'invoices',
                        'notes',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'invoices',
                        'bill_to_address',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'invoices',
                        'bill_to_name',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'invoices',
                        'currency',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'invoices',
                        'balance_due',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'invoices',
                        'total_amount',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'invoices',
                        'tax_amount',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'invoices',
                        'subtotal_amount',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'invoices',
                        'due_at',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'invoices',
                        'issued_at',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'invoices',
                        'status',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'invoices',
                        'invoice_number',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'invoices',
                        'reservationId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'invoices',
                        'organizationId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'invoices',
                        'tenantId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'service_requests',
                        'organizationsId',
                        { transaction }
                    );
                
            
                
            
                
            
                
                    await queryInterface.removeColumn(
                        'service_requests',
                        'currency',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'service_requests',
                        'actual_cost',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'service_requests',
                        'estimated_cost',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'service_requests',
                        'details',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'service_requests',
                        'summary',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'service_requests',
                        'completed_at',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'service_requests',
                        'due_at',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'service_requests',
                        'requested_at',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'service_requests',
                        'priority',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'service_requests',
                        'status',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'service_requests',
                        'request_type',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'service_requests',
                        'assigned_toId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'service_requests',
                        'requested_byId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'service_requests',
                        'reservationId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'service_requests',
                        'tenantId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'reservation_guests',
                        'organizationsId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'reservation_guests',
                        'notes',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'reservation_guests',
                        'primary_guest',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'reservation_guests',
                        'guest_type',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'reservation_guests',
                        'phone',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'reservation_guests',
                        'email',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'reservation_guests',
                        'full_name',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'reservation_guests',
                        'reservationId',
                        { transaction }
                    );
                
            
                
            
                
            
                
            
                
            
                
            
                
                    await queryInterface.removeColumn(
                        'reservations',
                        'external_notes',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'reservations',
                        'internal_notes',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'reservations',
                        'currency',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'reservations',
                        'monthly_rate',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'reservations',
                        'nightly_rate',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'reservations',
                        'guest_count',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'reservations',
                        'late_check_out',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'reservations',
                        'early_check_in',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'reservations',
                        'actual_check_out_at',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'reservations',
                        'actual_check_in_at',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'reservations',
                        'check_out_at',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'reservations',
                        'check_in_at',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'reservations',
                        'unit_typeId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'reservations',
                        'unitId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'reservations',
                        'propertyId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'reservations',
                        'status',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'reservations',
                        'reservation_code',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'reservations',
                        'booking_requestId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'reservations',
                        'organizationId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'reservations',
                        'tenantId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'approval_steps',
                        'organizationsId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'approval_steps',
                        'decision_notes',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'approval_steps',
                        'decided_at',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'approval_steps',
                        'decision',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'approval_steps',
                        'approverId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'approval_steps',
                        'step_order',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'approval_steps',
                        'booking_requestId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'booking_request_travelers',
                        'organizationsId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'booking_request_travelers',
                        'notes',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'booking_request_travelers',
                        'primary_traveler',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'booking_request_travelers',
                        'date_of_birth',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'booking_request_travelers',
                        'passport_number',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'booking_request_travelers',
                        'nationality',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'booking_request_travelers',
                        'phone',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'booking_request_travelers',
                        'email',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'booking_request_travelers',
                        'full_name',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'booking_request_travelers',
                        'booking_requestId',
                        { transaction }
                    );
                
            
                
            
                
            
                
            
                
            
                
                    await queryInterface.removeColumn(
                        'booking_requests',
                        'currency',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'booking_requests',
                        'max_budget_amount',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'booking_requests',
                        'budget_code',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'booking_requests',
                        'special_requirements',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'booking_requests',
                        'purpose_of_stay',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'booking_requests',
                        'guest_count',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'booking_requests',
                        'preferred_bedrooms',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'booking_requests',
                        'preferred_unit_typeId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'booking_requests',
                        'preferred_propertyId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'booking_requests',
                        'check_out_at',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'booking_requests',
                        'check_in_at',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'booking_requests',
                        'status',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'booking_requests',
                        'request_code',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'booking_requests',
                        'requested_byId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'booking_requests',
                        'organizationId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'booking_requests',
                        'tenantId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'negotiated_rates',
                        'notes',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'negotiated_rates',
                        'is_active',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'negotiated_rates',
                        'minimum_stay_nights',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'negotiated_rates',
                        'valid_until',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'negotiated_rates',
                        'valid_from',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'negotiated_rates',
                        'rate_amount',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'negotiated_rates',
                        'rate_type',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'negotiated_rates',
                        'unit_typeId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'negotiated_rates',
                        'propertyId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'negotiated_rates',
                        'organizationId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'unit_availability_blocks',
                        'organizationsId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'unit_availability_blocks',
                        'reservationId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'unit_availability_blocks',
                        'reason',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'unit_availability_blocks',
                        'end_at',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'unit_availability_blocks',
                        'start_at',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'unit_availability_blocks',
                        'block_type',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'unit_availability_blocks',
                        'unitId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'units',
                        'organizationsId',
                        { transaction }
                    );
                
            
                
            
                
                    await queryInterface.removeColumn(
                        'units',
                        'notes',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'units',
                        'max_occupancy_override',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'units',
                        'status',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'units',
                        'floor',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'units',
                        'unit_number',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'units',
                        'unit_typeId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'units',
                        'propertyId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'unit_types',
                        'organizationsId',
                        { transaction }
                    );
                
            
                
            
                
                    await queryInterface.removeColumn(
                        'unit_types',
                        'minimum_stay_nights',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'unit_types',
                        'base_monthly_rate',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'unit_types',
                        'base_nightly_rate',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'unit_types',
                        'description',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'unit_types',
                        'size_sqm',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'unit_types',
                        'bathrooms',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'unit_types',
                        'bedrooms',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'unit_types',
                        'max_occupancy',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'unit_types',
                        'code',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'unit_types',
                        'name',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'unit_types',
                        'propertyId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'amenities',
                        'organizationsId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'amenities',
                        'description',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'amenities',
                        'name',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'amenities',
                        'propertyId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'properties',
                        'organizationsId',
                        { transaction }
                    );
                
            
                
            
                
            
                
            
                
                    await queryInterface.removeColumn(
                        'properties',
                        'is_active',
                        { transaction }
                    );
                
            
                
            
                
                    await queryInterface.removeColumn(
                        'properties',
                        'description',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'properties',
                        'timezone',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'properties',
                        'country',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'properties',
                        'city',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'properties',
                        'address',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'properties',
                        'code',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'properties',
                        'name',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'properties',
                        'tenantId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'organization_memberships',
                        'phone',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'organization_memberships',
                        'job_title',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'organization_memberships',
                        'is_active',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'organization_memberships',
                        'is_primary',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'organization_memberships',
                        'member_role',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'organization_memberships',
                        'userId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'organization_memberships',
                        'organizationId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'role_assignments',
                        'effective_until',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'role_assignments',
                        'effective_from',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'role_assignments',
                        'is_active',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'role_assignments',
                        'organizationId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'role_assignments',
                        'tenantId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'role_assignments',
                        'roleId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'role_assignments',
                        'userId',
                        { transaction }
                    );
                
            
                
            
                
            
                
            
                
                    await queryInterface.removeColumn(
                        'tenants',
                        'is_active',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'tenants',
                        'default_currency',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'tenants',
                        'timezone',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'tenants',
                        'primary_domain',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'tenants',
                        'legal_name',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'tenants',
                        'slug',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'tenants',
                        'name',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'organizations',
                        'name',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'permissions',
                        'name',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'roles',
                        'globalAccess',
                        { transaction }
                    );
                
            
                
            
                
                    await queryInterface.removeColumn(
                        'roles',
                        'role_customization',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'roles',
                        'name',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'users',
                        'organizationsId',
                        { transaction }
                    );
                
            
                
            
                
                    await queryInterface.removeColumn(
                        'users',
                        'app_roleId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'users',
                        'provider',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'users',
                        'passwordResetTokenExpiresAt',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'users',
                        'passwordResetToken',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'users',
                        'emailVerificationTokenExpiresAt',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'users',
                        'emailVerificationToken',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'users',
                        'emailVerified',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'users',
                        'password',
                        { transaction }
                    );
                
            
                
            
                
                    await queryInterface.removeColumn(
                        'users',
                        'disabled',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'users',
                        'email',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'users',
                        'phoneNumber',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'users',
                        'lastName',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'users',
                        'firstName',
                        { transaction }
                    );
                
            
                
                    await queryInterface.dropTable('job_runs', { transaction });
                
            
                
                    await queryInterface.dropTable('checklist_items', { transaction });
                
            
                
                    await queryInterface.dropTable('checklists', { transaction });
                
            
                
                    await queryInterface.dropTable('activity_comments', { transaction });
                
            
                
                    await queryInterface.dropTable('notifications', { transaction });
                
            
                
                    await queryInterface.dropTable('audit_logs', { transaction });
                
            
                
                    await queryInterface.dropTable('documents', { transaction });
                
            
                
                    await queryInterface.dropTable('payments', { transaction });
                
            
                
                    await queryInterface.dropTable('invoice_line_items', { transaction });
                
            
                
                    await queryInterface.dropTable('invoices', { transaction });
                
            
                
                    await queryInterface.dropTable('service_requests', { transaction });
                
            
                
                    await queryInterface.dropTable('reservation_guests', { transaction });
                
            
                
                    await queryInterface.dropTable('reservations', { transaction });
                
            
                
                    await queryInterface.dropTable('approval_steps', { transaction });
                
            
                
                    await queryInterface.dropTable('booking_request_travelers', { transaction });
                
            
                
                    await queryInterface.dropTable('booking_requests', { transaction });
                
            
                
                    await queryInterface.dropTable('negotiated_rates', { transaction });
                
            
                
                    await queryInterface.dropTable('unit_availability_blocks', { transaction });
                
            
                
                    await queryInterface.dropTable('units', { transaction });
                
            
                
                    await queryInterface.dropTable('unit_types', { transaction });
                
            
                
                    await queryInterface.dropTable('amenities', { transaction });
                
            
                
                    await queryInterface.dropTable('properties', { transaction });
                
            
                
                    await queryInterface.dropTable('organization_memberships', { transaction });
                
            
                
                    await queryInterface.dropTable('role_assignments', { transaction });
                
            
                
                    await queryInterface.dropTable('tenants', { transaction });
                
            
                
                    await queryInterface.dropTable('organizations', { transaction });
                
            
                
                    await queryInterface.dropTable('permissions', { transaction });
                
            
                
                    await queryInterface.dropTable('roles', { transaction });
                
            
                
                    await queryInterface.dropTable('users', { transaction });
                
            
            await transaction.commit();
        } catch (err) {
            await transaction.rollback();
            throw err;
        }
    }
};
