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('patients', {
                        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('guarantors', {
                        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('doctors', {
                        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('visits', {
                        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('orders', {
                        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('radiology_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('radiology_studies', {
                        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('ct_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('ct_studies', {
                        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('lab_tests', {
                        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('lab_orders', {
                        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('lab_results', {
                        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('endoscopy_cases', {
                        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('surgery_cases', {
                        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('surgery_consumables', {
                        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('anesthesia_records', {
                        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('cathlab_cases', {
                        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('ecg_stress_tests', {
                        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('nursing_staff', {
                        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('cleaning_staff', {
                        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('inventory_consumables', {
                        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('pharmacy_inventory', {
                        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('pharmacy_sales_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('suppliers', {
                        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('purchases', {
                        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('patient_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('ledger_entries', {
                        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('journal_entries', {
                        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('trial_balances', {
                        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('closing_balances', {
                        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('inpatient_rooms', {
                        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('room_bookings', {
                        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('restaurant_meals', {
                        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('restaurant_inventory', {
                        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('maternity_cases', {
                        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('pregnancy_followups', {
                        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('nicu_incubators', {
                        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('daily_followup_clinic', {
                        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_log', {
                        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('settings', {
                        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(
                      'roles',
                      'name',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'roles',
                      'role_customization',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
            
                
                    
                    await queryInterface.addColumn(
                      'permissions',
                      'name',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'patients',
                      'full_name',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'patients',
                      'national_number',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'patients',
                      'phone',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'patients',
                      'address',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'patients',
                      'blood_group',
                      {
                          type: Sequelize.DataTypes.ENUM,
                          
                          
                            values: ['A+','A-','B+','B-','AB+','AB-','O+','O-'],
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'patients',
                      'gender',
                      {
                          type: Sequelize.DataTypes.ENUM,
                          
                          
                            values: ['male','female','other'],
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'patients',
                      'birth_date',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'patients',
                      'primary_doctorId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'doctors',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'guarantors',
                      'name',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'guarantors',
                      'national_number',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'guarantors',
                      'phone',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'guarantors',
                      'address',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'guarantors',
                      'patientId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'patients',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'doctors',
                      'full_name',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'doctors',
                      'national_number',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'doctors',
                      'hire_date',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'doctors',
                      'specialty',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'doctors',
                      'visit_price',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'doctors',
                      'doctor_type',
                      {
                          type: Sequelize.DataTypes.ENUM,
                          
                          
                            values: ['external','internal','resident'],
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'doctors',
                      'user_accountId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'users',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'visits',
                      'visit_number',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'visits',
                      'patientId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'patients',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'visits',
                      'guarantorId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'guarantors',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'visits',
                      'doctorId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'doctors',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'visits',
                      'department',
                      {
                          type: Sequelize.DataTypes.ENUM,
                          
                          
                            values: ['reception','emergency','clinic','surgery','maternity'],
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'visits',
                      'visit_price',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'visits',
                      'arrival_time',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'visits',
                      'discharge_time',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'visits',
                      'blood_pressure',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'visits',
                      'glucose',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'visits',
                      'pulse',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'visits',
                      'temperature',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'visits',
                      'spo2',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'visits',
                      'chief_complaint',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'visits',
                      'initial_diagnosis',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'visits',
                      'emergency_treatment',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'visits',
                      'fluids_iv',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'visits',
                      'notes',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'visits',
                      'status',
                      {
                          type: Sequelize.DataTypes.ENUM,
                          
                          
                            values: ['pending','in_progress','completed','admitted','cancelled'],
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'orders',
                      'order_number',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'orders',
                      'visitId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'visits',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'orders',
                      'patientId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'patients',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'orders',
                      'requested_byId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'doctors',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'orders',
                      'order_type',
                      {
                          type: Sequelize.DataTypes.ENUM,
                          
                          
                            values: ['lab','radiology','ct','endoscopy','ecg','other'],
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'orders',
                      'subtype',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'orders',
                      'price',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'orders',
                      'status',
                      {
                          type: Sequelize.DataTypes.ENUM,
                          
                          
                            values: ['pending','in_progress','completed','cancelled'],
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'orders',
                      'created_datetime',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'radiology_types',
                      'name',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'radiology_types',
                      'price',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'radiology_types',
                      'notes',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'radiology_studies',
                      'study_number',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'radiology_studies',
                      'orderId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'orders',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'radiology_studies',
                      'study_typeId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'radiology_types',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'radiology_studies',
                      'technicianId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'users',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
            
                
                    
                    await queryInterface.addColumn(
                      'radiology_studies',
                      'report_summary',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'radiology_studies',
                      'price',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'radiology_studies',
                      'status',
                      {
                          type: Sequelize.DataTypes.ENUM,
                          
                          
                            values: ['pending','completed','cancelled'],
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'ct_types',
                      'name',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'ct_types',
                      'price',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'ct_studies',
                      'ct_number',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'ct_studies',
                      'orderId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'orders',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'ct_studies',
                      'ct_typeId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'ct_types',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
            
                
                    
                    await queryInterface.addColumn(
                      'ct_studies',
                      'result_text',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'ct_studies',
                      'status',
                      {
                          type: Sequelize.DataTypes.ENUM,
                          
                          
                            values: ['pending','completed','cancelled'],
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'ct_studies',
                      'price',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'lab_tests',
                      'code',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'lab_tests',
                      'name',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'lab_tests',
                      'unit',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'lab_tests',
                      'reference_range',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'lab_tests',
                      'price',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'lab_tests',
                      'notes',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'lab_orders',
                      'lab_order_number',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'lab_orders',
                      'orderId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'orders',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
            
                
                    
                    await queryInterface.addColumn(
                      'lab_orders',
                      'lab_technicianId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'users',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'lab_orders',
                      'status',
                      {
                          type: Sequelize.DataTypes.ENUM,
                          
                          
                            values: ['pending','in_progress','completed'],
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'lab_results',
                      'lab_orderId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'lab_orders',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'lab_results',
                      'testId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'lab_tests',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'lab_results',
                      'result_value',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'lab_results',
                      'unit',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'lab_results',
                      'reference_range',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'lab_results',
                      'remarks',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'endoscopy_cases',
                      'case_number',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'endoscopy_cases',
                      'visitId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'visits',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'endoscopy_cases',
                      'doctorId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'doctors',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'endoscopy_cases',
                      'diagnosis',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'endoscopy_cases',
                      'procedure_details',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'endoscopy_cases',
                      'recommendations',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
            
                
                    
                    await queryInterface.addColumn(
                      'endoscopy_cases',
                      'price',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'endoscopy_cases',
                      'status',
                      {
                          type: Sequelize.DataTypes.ENUM,
                          
                          
                            values: ['pending','completed','sent_to_doctor'],
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'surgery_cases',
                      'case_number',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'surgery_cases',
                      'patientId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'patients',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'surgery_cases',
                      'surgeonId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'doctors',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'surgery_cases',
                      'scheduled_start',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'surgery_cases',
                      'scheduled_end',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'surgery_cases',
                      'surgical_details',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'surgery_cases',
                      'price',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
            
                
                    
                    await queryInterface.addColumn(
                      'surgery_cases',
                      'status',
                      {
                          type: Sequelize.DataTypes.ENUM,
                          
                          
                            values: ['scheduled','in_progress','completed','cancelled'],
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'surgery_consumables',
                      'name',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'surgery_consumables',
                      'quantity',
                      {
                          type: Sequelize.DataTypes.INTEGER,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'surgery_consumables',
                      'unit_price',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'surgery_consumables',
                      'total_price',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'surgery_consumables',
                      'surgery_caseId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'surgery_cases',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'anesthesia_records',
                      'surgery_caseId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'surgery_cases',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'anesthesia_records',
                      'medications',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'anesthesia_records',
                      'start_time',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'anesthesia_records',
                      'end_time',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'anesthesia_records',
                      'recovery_notes',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'anesthesia_records',
                      'price',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'cathlab_cases',
                      'case_number',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'cathlab_cases',
                      'patientId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'patients',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'cathlab_cases',
                      'doctorId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'doctors',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'cathlab_cases',
                      'procedure_details',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'cathlab_cases',
                      'price',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'cathlab_cases',
                      'scheduled_date',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'cathlab_cases',
                      'status',
                      {
                          type: Sequelize.DataTypes.ENUM,
                          
                          
                            values: ['scheduled','completed','cancelled'],
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'ecg_stress_tests',
                      'test_number',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'ecg_stress_tests',
                      'patientId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'patients',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'ecg_stress_tests',
                      'doctorId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'doctors',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
            
                
                    
                    await queryInterface.addColumn(
                      'ecg_stress_tests',
                      'result_text',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'ecg_stress_tests',
                      'price',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'nursing_staff',
                      'full_name',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'nursing_staff',
                      'national_number',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'nursing_staff',
                      'specialty',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'nursing_staff',
                      'address',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'nursing_staff',
                      'phone',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'nursing_staff',
                      'marital_status',
                      {
                          type: Sequelize.DataTypes.ENUM,
                          
                          
                            values: ['single','married','widowed','divorced'],
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'nursing_staff',
                      'children_count',
                      {
                          type: Sequelize.DataTypes.INTEGER,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'nursing_staff',
                      'night_shifts',
                      {
                          type: Sequelize.DataTypes.BOOLEAN,
                          
                            defaultValue: false,
                            allowNull: false,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'nursing_staff',
                      'salary',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'nursing_staff',
                      'bonuses',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'nursing_staff',
                      'hire_date',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'cleaning_staff',
                      'full_name',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'cleaning_staff',
                      'national_number',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'cleaning_staff',
                      'phone',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'cleaning_staff',
                      'address',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'cleaning_staff',
                      'specialty',
                      {
                          type: Sequelize.DataTypes.ENUM,
                          
                          
                            values: ['cleaning','sterilization'],
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'cleaning_staff',
                      'salary',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'cleaning_staff',
                      'bonuses',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'cleaning_staff',
                      'hire_date',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'inventory_consumables',
                      'name',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'inventory_consumables',
                      'received_quantity',
                      {
                          type: Sequelize.DataTypes.INTEGER,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'inventory_consumables',
                      'available_quantity',
                      {
                          type: Sequelize.DataTypes.INTEGER,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'inventory_consumables',
                      'shortage',
                      {
                          type: Sequelize.DataTypes.INTEGER,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'inventory_consumables',
                      'last_received_date',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'inventory_consumables',
                      'last_issued_date',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'inventory_consumables',
                      'last_supplier',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'pharmacy_inventory',
                      'drug_name',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'pharmacy_inventory',
                      'supplier',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'pharmacy_inventory',
                      'wholesale_price',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'pharmacy_inventory',
                      'retail_price',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'pharmacy_inventory',
                      'quantity',
                      {
                          type: Sequelize.DataTypes.INTEGER,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'pharmacy_inventory',
                      'expiry_date',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'pharmacy_inventory',
                      'batch_number',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'pharmacy_sales_invoices',
                      'invoice_number',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'pharmacy_sales_invoices',
                      'patientId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'patients',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'pharmacy_sales_invoices',
                      'items',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'pharmacy_sales_invoices',
                      'total_amount',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'pharmacy_sales_invoices',
                      'tax',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'pharmacy_sales_invoices',
                      'final_price',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'pharmacy_sales_invoices',
                      'date',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'pharmacy_sales_invoices',
                      'cashierId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'users',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'suppliers',
                      'name',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'suppliers',
                      'phone',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'suppliers',
                      'address',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'purchases',
                      'purchase_number',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'purchases',
                      'supplierId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'suppliers',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'purchases',
                      'items',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'purchases',
                      'total',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'purchases',
                      'date',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'patient_invoices',
                      'invoice_number',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'patient_invoices',
                      'patientId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'patients',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'patient_invoices',
                      'items',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'patient_invoices',
                      'subtotal',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'patient_invoices',
                      'tax',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'patient_invoices',
                      'total',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'patient_invoices',
                      'status',
                      {
                          type: Sequelize.DataTypes.ENUM,
                          
                          
                            values: ['unpaid','paid','partial'],
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'patient_invoices',
                      'hide_real_price',
                      {
                          type: Sequelize.DataTypes.BOOLEAN,
                          
                            defaultValue: false,
                            allowNull: false,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'patient_invoices',
                      'print_price',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'ledger_entries',
                      'entry_number',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'ledger_entries',
                      'date',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'ledger_entries',
                      'account',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'ledger_entries',
                      'debit',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'ledger_entries',
                      'credit',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'ledger_entries',
                      'description',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'journal_entries',
                      'journal_number',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'journal_entries',
                      'date',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'journal_entries',
                      'entries',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'journal_entries',
                      'total_debit',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'journal_entries',
                      'total_credit',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'trial_balances',
                      'report_name',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'trial_balances',
                      'period_start',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'trial_balances',
                      'period_end',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'trial_balances',
                      'notes',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'closing_balances',
                      'report_name',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'closing_balances',
                      'period_start',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'closing_balances',
                      'period_end',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'closing_balances',
                      'notes',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'inpatient_rooms',
                      'room_number',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'inpatient_rooms',
                      'ward_name',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'inpatient_rooms',
                      'room_type',
                      {
                          type: Sequelize.DataTypes.ENUM,
                          
                          
                            values: ['single','double','icu'],
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'inpatient_rooms',
                      'price_per_day',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'inpatient_rooms',
                      'capacity',
                      {
                          type: Sequelize.DataTypes.INTEGER,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'inpatient_rooms',
                      'is_available',
                      {
                          type: Sequelize.DataTypes.BOOLEAN,
                          
                            defaultValue: false,
                            allowNull: false,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'room_bookings',
                      'booking_number',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'room_bookings',
                      'patientId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'patients',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'room_bookings',
                      'roomId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'inpatient_rooms',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'room_bookings',
                      'admission_date',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'room_bookings',
                      'discharge_date',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'room_bookings',
                      'days',
                      {
                          type: Sequelize.DataTypes.INTEGER,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'room_bookings',
                      'price_per_day',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'room_bookings',
                      'total_price',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'room_bookings',
                      'supervising_nurseId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'nursing_staff',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'room_bookings',
                      'supervising_doctorId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'doctors',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'restaurant_meals',
                      'name',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'restaurant_meals',
                      'quantity_received',
                      {
                          type: Sequelize.DataTypes.INTEGER,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'restaurant_meals',
                      'quantity_kg',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'restaurant_meals',
                      'shortage',
                      {
                          type: Sequelize.DataTypes.INTEGER,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'restaurant_meals',
                      'estimated_cost',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'restaurant_meals',
                      'distributed_count',
                      {
                          type: Sequelize.DataTypes.INTEGER,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'restaurant_meals',
                      'drinks_count',
                      {
                          type: Sequelize.DataTypes.INTEGER,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'restaurant_inventory',
                      'name',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'restaurant_inventory',
                      'quantity_received',
                      {
                          type: Sequelize.DataTypes.INTEGER,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'restaurant_inventory',
                      'quantity_kg',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'restaurant_inventory',
                      'shortage',
                      {
                          type: Sequelize.DataTypes.INTEGER,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'restaurant_inventory',
                      'last_supply_date',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'restaurant_inventory',
                      'unit',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'maternity_cases',
                      'case_number',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'maternity_cases',
                      'patientId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'patients',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'maternity_cases',
                      'doctorId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'doctors',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'maternity_cases',
                      'diagnosis',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'maternity_cases',
                      'delivery_type',
                      {
                          type: Sequelize.DataTypes.ENUM,
                          
                          
                            values: ['natural','csection','assisted'],
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'maternity_cases',
                      'admission_date',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'maternity_cases',
                      'discharge_date',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'maternity_cases',
                      'price',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'pregnancy_followups',
                      'followup_number',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'pregnancy_followups',
                      'patientId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'patients',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'pregnancy_followups',
                      'weight',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'pregnancy_followups',
                      'blood_pressure',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'pregnancy_followups',
                      'delivery_plan',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'pregnancy_followups',
                      'next_visit_date',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'pregnancy_followups',
                      'price',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'pregnancy_followups',
                      'notes',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'nicu_incubators',
                      'incubator_number',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'nicu_incubators',
                      'baby_name',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'nicu_incubators',
                      'baby_age',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'nicu_incubators',
                      'medications',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'nicu_incubators',
                      'devices',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'nicu_incubators',
                      'daily_price',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'nicu_incubators',
                      'admitting_doctorId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'doctors',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'nicu_incubators',
                      'admission_date',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'nicu_incubators',
                      'discharge_date',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'nicu_incubators',
                      'cancellation_reason',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'daily_followup_clinic',
                      'record_number',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'daily_followup_clinic',
                      'patientId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'patients',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'daily_followup_clinic',
                      'condition_type',
                      {
                          type: Sequelize.DataTypes.ENUM,
                          
                          
                            values: ['diabetes','hypertension','other'],
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'daily_followup_clinic',
                      'route',
                      {
                          type: Sequelize.DataTypes.ENUM,
                          
                          
                            values: ['iv','oral'],
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'daily_followup_clinic',
                      'notes',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'daily_followup_clinic',
                      'send_to_accounting',
                      {
                          type: Sequelize.DataTypes.BOOLEAN,
                          
                            defaultValue: false,
                            allowNull: false,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'daily_followup_clinic',
                      'price',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'audit_log',
                      'action',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'audit_log',
                      'userId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'users',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'audit_log',
                      'entity',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'audit_log',
                      'entity_ref',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'audit_log',
                      'action_time',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'audit_log',
                      'details',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'settings',
                      'key',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'settings',
                      'value',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'settings',
                      'theme_color',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'settings',
                      'rtl',
                      {
                          type: Sequelize.DataTypes.BOOLEAN,
                          
                            defaultValue: false,
                            allowNull: false,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'settings',
                      'hospital_name',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'settings',
                      'phone',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { 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(
                        'settings',
                        'phone',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'settings',
                        'hospital_name',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'settings',
                        'rtl',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'settings',
                        'theme_color',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'settings',
                        'value',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'settings',
                        'key',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'audit_log',
                        'details',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'audit_log',
                        'action_time',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'audit_log',
                        'entity_ref',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'audit_log',
                        'entity',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'audit_log',
                        'userId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'audit_log',
                        'action',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'daily_followup_clinic',
                        'price',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'daily_followup_clinic',
                        'send_to_accounting',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'daily_followup_clinic',
                        'notes',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'daily_followup_clinic',
                        'route',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'daily_followup_clinic',
                        'condition_type',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'daily_followup_clinic',
                        'patientId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'daily_followup_clinic',
                        'record_number',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'nicu_incubators',
                        'cancellation_reason',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'nicu_incubators',
                        'discharge_date',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'nicu_incubators',
                        'admission_date',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'nicu_incubators',
                        'admitting_doctorId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'nicu_incubators',
                        'daily_price',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'nicu_incubators',
                        'devices',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'nicu_incubators',
                        'medications',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'nicu_incubators',
                        'baby_age',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'nicu_incubators',
                        'baby_name',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'nicu_incubators',
                        'incubator_number',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'pregnancy_followups',
                        'notes',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'pregnancy_followups',
                        'price',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'pregnancy_followups',
                        'next_visit_date',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'pregnancy_followups',
                        'delivery_plan',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'pregnancy_followups',
                        'blood_pressure',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'pregnancy_followups',
                        'weight',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'pregnancy_followups',
                        'patientId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'pregnancy_followups',
                        'followup_number',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'maternity_cases',
                        'price',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'maternity_cases',
                        'discharge_date',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'maternity_cases',
                        'admission_date',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'maternity_cases',
                        'delivery_type',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'maternity_cases',
                        'diagnosis',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'maternity_cases',
                        'doctorId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'maternity_cases',
                        'patientId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'maternity_cases',
                        'case_number',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'restaurant_inventory',
                        'unit',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'restaurant_inventory',
                        'last_supply_date',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'restaurant_inventory',
                        'shortage',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'restaurant_inventory',
                        'quantity_kg',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'restaurant_inventory',
                        'quantity_received',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'restaurant_inventory',
                        'name',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'restaurant_meals',
                        'drinks_count',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'restaurant_meals',
                        'distributed_count',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'restaurant_meals',
                        'estimated_cost',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'restaurant_meals',
                        'shortage',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'restaurant_meals',
                        'quantity_kg',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'restaurant_meals',
                        'quantity_received',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'restaurant_meals',
                        'name',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'room_bookings',
                        'supervising_doctorId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'room_bookings',
                        'supervising_nurseId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'room_bookings',
                        'total_price',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'room_bookings',
                        'price_per_day',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'room_bookings',
                        'days',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'room_bookings',
                        'discharge_date',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'room_bookings',
                        'admission_date',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'room_bookings',
                        'roomId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'room_bookings',
                        'patientId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'room_bookings',
                        'booking_number',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'inpatient_rooms',
                        'is_available',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'inpatient_rooms',
                        'capacity',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'inpatient_rooms',
                        'price_per_day',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'inpatient_rooms',
                        'room_type',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'inpatient_rooms',
                        'ward_name',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'inpatient_rooms',
                        'room_number',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'closing_balances',
                        'notes',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'closing_balances',
                        'period_end',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'closing_balances',
                        'period_start',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'closing_balances',
                        'report_name',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'trial_balances',
                        'notes',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'trial_balances',
                        'period_end',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'trial_balances',
                        'period_start',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'trial_balances',
                        'report_name',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'journal_entries',
                        'total_credit',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'journal_entries',
                        'total_debit',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'journal_entries',
                        'entries',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'journal_entries',
                        'date',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'journal_entries',
                        'journal_number',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'ledger_entries',
                        'description',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'ledger_entries',
                        'credit',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'ledger_entries',
                        'debit',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'ledger_entries',
                        'account',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'ledger_entries',
                        'date',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'ledger_entries',
                        'entry_number',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'patient_invoices',
                        'print_price',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'patient_invoices',
                        'hide_real_price',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'patient_invoices',
                        'status',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'patient_invoices',
                        'total',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'patient_invoices',
                        'tax',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'patient_invoices',
                        'subtotal',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'patient_invoices',
                        'items',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'patient_invoices',
                        'patientId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'patient_invoices',
                        'invoice_number',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'purchases',
                        'date',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'purchases',
                        'total',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'purchases',
                        'items',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'purchases',
                        'supplierId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'purchases',
                        'purchase_number',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'suppliers',
                        'address',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'suppliers',
                        'phone',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'suppliers',
                        'name',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'pharmacy_sales_invoices',
                        'cashierId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'pharmacy_sales_invoices',
                        'date',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'pharmacy_sales_invoices',
                        'final_price',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'pharmacy_sales_invoices',
                        'tax',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'pharmacy_sales_invoices',
                        'total_amount',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'pharmacy_sales_invoices',
                        'items',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'pharmacy_sales_invoices',
                        'patientId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'pharmacy_sales_invoices',
                        'invoice_number',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'pharmacy_inventory',
                        'batch_number',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'pharmacy_inventory',
                        'expiry_date',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'pharmacy_inventory',
                        'quantity',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'pharmacy_inventory',
                        'retail_price',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'pharmacy_inventory',
                        'wholesale_price',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'pharmacy_inventory',
                        'supplier',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'pharmacy_inventory',
                        'drug_name',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'inventory_consumables',
                        'last_supplier',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'inventory_consumables',
                        'last_issued_date',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'inventory_consumables',
                        'last_received_date',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'inventory_consumables',
                        'shortage',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'inventory_consumables',
                        'available_quantity',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'inventory_consumables',
                        'received_quantity',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'inventory_consumables',
                        'name',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'cleaning_staff',
                        'hire_date',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'cleaning_staff',
                        'bonuses',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'cleaning_staff',
                        'salary',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'cleaning_staff',
                        'specialty',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'cleaning_staff',
                        'address',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'cleaning_staff',
                        'phone',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'cleaning_staff',
                        'national_number',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'cleaning_staff',
                        'full_name',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'nursing_staff',
                        'hire_date',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'nursing_staff',
                        'bonuses',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'nursing_staff',
                        'salary',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'nursing_staff',
                        'night_shifts',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'nursing_staff',
                        'children_count',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'nursing_staff',
                        'marital_status',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'nursing_staff',
                        'phone',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'nursing_staff',
                        'address',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'nursing_staff',
                        'specialty',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'nursing_staff',
                        'national_number',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'nursing_staff',
                        'full_name',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'ecg_stress_tests',
                        'price',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'ecg_stress_tests',
                        'result_text',
                        { transaction }
                    );
                
            
                
            
                
                    await queryInterface.removeColumn(
                        'ecg_stress_tests',
                        'doctorId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'ecg_stress_tests',
                        'patientId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'ecg_stress_tests',
                        'test_number',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'cathlab_cases',
                        'status',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'cathlab_cases',
                        'scheduled_date',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'cathlab_cases',
                        'price',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'cathlab_cases',
                        'procedure_details',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'cathlab_cases',
                        'doctorId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'cathlab_cases',
                        'patientId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'cathlab_cases',
                        'case_number',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'anesthesia_records',
                        'price',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'anesthesia_records',
                        'recovery_notes',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'anesthesia_records',
                        'end_time',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'anesthesia_records',
                        'start_time',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'anesthesia_records',
                        'medications',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'anesthesia_records',
                        'surgery_caseId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'surgery_consumables',
                        'surgery_caseId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'surgery_consumables',
                        'total_price',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'surgery_consumables',
                        'unit_price',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'surgery_consumables',
                        'quantity',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'surgery_consumables',
                        'name',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'surgery_cases',
                        'status',
                        { transaction }
                    );
                
            
                
            
                
                    await queryInterface.removeColumn(
                        'surgery_cases',
                        'price',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'surgery_cases',
                        'surgical_details',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'surgery_cases',
                        'scheduled_end',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'surgery_cases',
                        'scheduled_start',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'surgery_cases',
                        'surgeonId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'surgery_cases',
                        'patientId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'surgery_cases',
                        'case_number',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'endoscopy_cases',
                        'status',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'endoscopy_cases',
                        'price',
                        { transaction }
                    );
                
            
                
            
                
                    await queryInterface.removeColumn(
                        'endoscopy_cases',
                        'recommendations',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'endoscopy_cases',
                        'procedure_details',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'endoscopy_cases',
                        'diagnosis',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'endoscopy_cases',
                        'doctorId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'endoscopy_cases',
                        'visitId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'endoscopy_cases',
                        'case_number',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'lab_results',
                        'remarks',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'lab_results',
                        'reference_range',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'lab_results',
                        'unit',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'lab_results',
                        'result_value',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'lab_results',
                        'testId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'lab_results',
                        'lab_orderId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'lab_orders',
                        'status',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'lab_orders',
                        'lab_technicianId',
                        { transaction }
                    );
                
            
                
            
                
                    await queryInterface.removeColumn(
                        'lab_orders',
                        'orderId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'lab_orders',
                        'lab_order_number',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'lab_tests',
                        'notes',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'lab_tests',
                        'price',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'lab_tests',
                        'reference_range',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'lab_tests',
                        'unit',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'lab_tests',
                        'name',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'lab_tests',
                        'code',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'ct_studies',
                        'price',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'ct_studies',
                        'status',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'ct_studies',
                        'result_text',
                        { transaction }
                    );
                
            
                
            
                
                    await queryInterface.removeColumn(
                        'ct_studies',
                        'ct_typeId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'ct_studies',
                        'orderId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'ct_studies',
                        'ct_number',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'ct_types',
                        'price',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'ct_types',
                        'name',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'radiology_studies',
                        'status',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'radiology_studies',
                        'price',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'radiology_studies',
                        'report_summary',
                        { transaction }
                    );
                
            
                
            
                
                    await queryInterface.removeColumn(
                        'radiology_studies',
                        'technicianId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'radiology_studies',
                        'study_typeId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'radiology_studies',
                        'orderId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'radiology_studies',
                        'study_number',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'radiology_types',
                        'notes',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'radiology_types',
                        'price',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'radiology_types',
                        'name',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'orders',
                        'created_datetime',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'orders',
                        'status',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'orders',
                        'price',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'orders',
                        'subtype',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'orders',
                        'order_type',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'orders',
                        'requested_byId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'orders',
                        'patientId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'orders',
                        'visitId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'orders',
                        'order_number',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'visits',
                        'status',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'visits',
                        'notes',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'visits',
                        'fluids_iv',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'visits',
                        'emergency_treatment',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'visits',
                        'initial_diagnosis',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'visits',
                        'chief_complaint',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'visits',
                        'spo2',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'visits',
                        'temperature',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'visits',
                        'pulse',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'visits',
                        'glucose',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'visits',
                        'blood_pressure',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'visits',
                        'discharge_time',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'visits',
                        'arrival_time',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'visits',
                        'visit_price',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'visits',
                        'department',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'visits',
                        'doctorId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'visits',
                        'guarantorId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'visits',
                        'patientId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'visits',
                        'visit_number',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'doctors',
                        'user_accountId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'doctors',
                        'doctor_type',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'doctors',
                        'visit_price',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'doctors',
                        'specialty',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'doctors',
                        'hire_date',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'doctors',
                        'national_number',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'doctors',
                        'full_name',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'guarantors',
                        'patientId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'guarantors',
                        'address',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'guarantors',
                        'phone',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'guarantors',
                        'national_number',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'guarantors',
                        'name',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'patients',
                        'primary_doctorId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'patients',
                        'birth_date',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'patients',
                        'gender',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'patients',
                        'blood_group',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'patients',
                        'address',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'patients',
                        'phone',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'patients',
                        'national_number',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'patients',
                        'full_name',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'permissions',
                        'name',
                        { transaction }
                    );
                
            
                
            
                
                    await queryInterface.removeColumn(
                        'roles',
                        'role_customization',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'roles',
                        'name',
                        { 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('settings', { transaction });
                
            
                
                    await queryInterface.dropTable('audit_log', { transaction });
                
            
                
                    await queryInterface.dropTable('daily_followup_clinic', { transaction });
                
            
                
                    await queryInterface.dropTable('nicu_incubators', { transaction });
                
            
                
                    await queryInterface.dropTable('pregnancy_followups', { transaction });
                
            
                
                    await queryInterface.dropTable('maternity_cases', { transaction });
                
            
                
                    await queryInterface.dropTable('restaurant_inventory', { transaction });
                
            
                
                    await queryInterface.dropTable('restaurant_meals', { transaction });
                
            
                
                    await queryInterface.dropTable('room_bookings', { transaction });
                
            
                
                    await queryInterface.dropTable('inpatient_rooms', { transaction });
                
            
                
                    await queryInterface.dropTable('closing_balances', { transaction });
                
            
                
                    await queryInterface.dropTable('trial_balances', { transaction });
                
            
                
                    await queryInterface.dropTable('journal_entries', { transaction });
                
            
                
                    await queryInterface.dropTable('ledger_entries', { transaction });
                
            
                
                    await queryInterface.dropTable('patient_invoices', { transaction });
                
            
                
                    await queryInterface.dropTable('purchases', { transaction });
                
            
                
                    await queryInterface.dropTable('suppliers', { transaction });
                
            
                
                    await queryInterface.dropTable('pharmacy_sales_invoices', { transaction });
                
            
                
                    await queryInterface.dropTable('pharmacy_inventory', { transaction });
                
            
                
                    await queryInterface.dropTable('inventory_consumables', { transaction });
                
            
                
                    await queryInterface.dropTable('cleaning_staff', { transaction });
                
            
                
                    await queryInterface.dropTable('nursing_staff', { transaction });
                
            
                
                    await queryInterface.dropTable('ecg_stress_tests', { transaction });
                
            
                
                    await queryInterface.dropTable('cathlab_cases', { transaction });
                
            
                
                    await queryInterface.dropTable('anesthesia_records', { transaction });
                
            
                
                    await queryInterface.dropTable('surgery_consumables', { transaction });
                
            
                
                    await queryInterface.dropTable('surgery_cases', { transaction });
                
            
                
                    await queryInterface.dropTable('endoscopy_cases', { transaction });
                
            
                
                    await queryInterface.dropTable('lab_results', { transaction });
                
            
                
                    await queryInterface.dropTable('lab_orders', { transaction });
                
            
                
                    await queryInterface.dropTable('lab_tests', { transaction });
                
            
                
                    await queryInterface.dropTable('ct_studies', { transaction });
                
            
                
                    await queryInterface.dropTable('ct_types', { transaction });
                
            
                
                    await queryInterface.dropTable('radiology_studies', { transaction });
                
            
                
                    await queryInterface.dropTable('radiology_types', { transaction });
                
            
                
                    await queryInterface.dropTable('orders', { transaction });
                
            
                
                    await queryInterface.dropTable('visits', { transaction });
                
            
                
                    await queryInterface.dropTable('doctors', { transaction });
                
            
                
                    await queryInterface.dropTable('guarantors', { transaction });
                
            
                
                    await queryInterface.dropTable('patients', { 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;
        }
    }
};
