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('branches', {
                        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('calendars', {
                        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('client_status', {
                        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('clients', {
                        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('communes', {
                        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('deposits', {
                        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('districts', {
                        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('document_type', {
                        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('expense_items', {
                        id: {
                            type: Sequelize.DataTypes.UUID,
                            defaultValue: Sequelize.DataTypes.UUIDV4,
                            primaryKey: true,
                        },
                        createdById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        updatedById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        createdAt: { type: Sequelize.DataTypes.DATE },
                        updatedAt: { type: Sequelize.DataTypes.DATE },
                        deletedAt: { type: Sequelize.DataTypes.DATE },
                        importHash: {
                            type: Sequelize.DataTypes.STRING(255),
                            allowNull: true,
                          unique: true, 
                        },
                    }, { transaction });

                    await queryInterface.createTable('expense_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('group_menus', {
                        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('guarantor', {
                        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('interest_rates', {
                        id: {
                            type: Sequelize.DataTypes.UUID,
                            defaultValue: Sequelize.DataTypes.UUIDV4,
                            primaryKey: true,
                        },
                        createdById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        updatedById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        createdAt: { type: Sequelize.DataTypes.DATE },
                        updatedAt: { type: Sequelize.DataTypes.DATE },
                        deletedAt: { type: Sequelize.DataTypes.DATE },
                        importHash: {
                            type: Sequelize.DataTypes.STRING(255),
                            allowNull: true,
                          unique: true, 
                        },
                    }, { transaction });

                    await queryInterface.createTable('loan_status', {
                        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('loan_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('loans', {
                        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('members', {
                        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('menus', {
                        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('payment_revenues', {
                        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('payment_status', {
                        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('payment_transactions', {
                        id: {
                            type: Sequelize.DataTypes.UUID,
                            defaultValue: Sequelize.DataTypes.UUIDV4,
                            primaryKey: true,
                        },
                        createdById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        updatedById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        createdAt: { type: Sequelize.DataTypes.DATE },
                        updatedAt: { type: Sequelize.DataTypes.DATE },
                        deletedAt: { type: Sequelize.DataTypes.DATE },
                        importHash: {
                            type: Sequelize.DataTypes.STRING(255),
                            allowNull: true,
                          unique: true, 
                        },
                    }, { transaction });

                    await queryInterface.createTable('payments', {
                        id: {
                            type: Sequelize.DataTypes.UUID,
                            defaultValue: Sequelize.DataTypes.UUIDV4,
                            primaryKey: true,
                        },
                        createdById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        updatedById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        createdAt: { type: Sequelize.DataTypes.DATE },
                        updatedAt: { type: Sequelize.DataTypes.DATE },
                        deletedAt: { type: Sequelize.DataTypes.DATE },
                        importHash: {
                            type: Sequelize.DataTypes.STRING(255),
                            allowNull: true,
                          unique: true, 
                        },
                    }, { transaction });

                    await queryInterface.createTable('provinces', {
                        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('sexes', {
                        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('shareholders', {
                        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('staff_status', {
                        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('staffs', {
                        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('urls', {
                        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('user_has_menu', {
                        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('user_type_urls', {
                        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('user_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('villages', {
                        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(
                      'branches',
                      'code',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'branches',
                      'name',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'branches',
                      'description',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'calendars',
                      'date',
                      {
                          type: Sequelize.DataTypes.DATE,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'calendars',
                      'is_weekend',
                      {
                          type: Sequelize.DataTypes.BOOLEAN,

                            defaultValue: false,
                            allowNull: false,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'calendars',
                      'is_holiday',
                      {
                          type: Sequelize.DataTypes.BOOLEAN,

                            defaultValue: false,
                            allowNull: false,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'calendars',
                      'description',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'calendars',
                      'flag',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'client_status',
                      'name',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'clients',
                      'code',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'clients',
                      'name_en',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'clients',
                      'name_kh',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'clients',
                      'date_of_birth',
                      {
                          type: Sequelize.DataTypes.DATE,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'clients',
                      'phone_number',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'clients',
                      'is_new',
                      {
                          type: Sequelize.DataTypes.BOOLEAN,

                            defaultValue: false,
                            allowNull: false,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'clients',
                      'document_typeId',
                      {
                          type: Sequelize.DataTypes.UUID,

                            references: {
                                model: 'document_type',
                                key: 'id',
                            },

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'clients',
                      'document_number',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'clients',
                      'sex',
                      {
                          type: Sequelize.DataTypes.ENUM,

                            values: ['M','F'],

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'clients',
                      'statusId',
                      {
                          type: Sequelize.DataTypes.UUID,

                            references: {
                                model: 'client_status',
                                key: 'id',
                            },

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'clients',
                      'userId',
                      {
                          type: Sequelize.DataTypes.UUID,

                            references: {
                                model: 'users',
                                key: 'id',
                            },

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'clients',
                      'provinceId',
                      {
                          type: Sequelize.DataTypes.UUID,

                            references: {
                                model: 'provinces',
                                key: 'id',
                            },

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'clients',
                      'districtId',
                      {
                          type: Sequelize.DataTypes.UUID,

                            references: {
                                model: 'districts',
                                key: 'id',
                            },

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'clients',
                      'communeId',
                      {
                          type: Sequelize.DataTypes.UUID,

                            references: {
                                model: 'communes',
                                key: 'id',
                            },

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'clients',
                      'villageId',
                      {
                          type: Sequelize.DataTypes.UUID,

                            references: {
                                model: 'villages',
                                key: 'id',
                            },

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'clients',
                      'branchId',
                      {
                          type: Sequelize.DataTypes.UUID,

                            references: {
                                model: 'branches',
                                key: 'id',
                            },

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'communes',
                      'name_kh',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'communes',
                      'name_en',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'communes',
                      'districtId',
                      {
                          type: Sequelize.DataTypes.UUID,

                            references: {
                                model: 'districts',
                                key: 'id',
                            },

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'deposits',
                      'deposit_datetime',
                      {
                          type: Sequelize.DataTypes.DATE,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'deposits',
                      'deposit_amount',
                      {
                          type: Sequelize.DataTypes.DECIMAL,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'deposits',
                      'shareholderId',
                      {
                          type: Sequelize.DataTypes.UUID,

                            references: {
                                model: 'shareholders',
                                key: 'id',
                            },

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'deposits',
                      'branchId',
                      {
                          type: Sequelize.DataTypes.UUID,

                            references: {
                                model: 'branches',
                                key: 'id',
                            },

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'districts',
                      'name_kh',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'districts',
                      'name_en',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'districts',
                      'provinceId',
                      {
                          type: Sequelize.DataTypes.UUID,

                            references: {
                                model: 'provinces',
                                key: 'id',
                            },

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'document_type',
                      'name',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'expense_items',
                      'expense_datetime',
                      {
                          type: Sequelize.DataTypes.DATE,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'expense_items',
                      'description',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'expense_items',
                      'expense_amount',
                      {
                          type: Sequelize.DataTypes.DECIMAL,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'expense_items',
                      'expense_typeId',
                      {
                          type: Sequelize.DataTypes.UUID,

                            references: {
                                model: 'expense_types',
                                key: 'id',
                            },

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'expense_items',
                      'branchId',
                      {
                          type: Sequelize.DataTypes.UUID,

                            references: {
                                model: 'branches',
                                key: 'id',
                            },

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'expense_types',
                      'name_kh',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'expense_types',
                      'name_en',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'group_menus',
                      'name',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'group_menus',
                      'is_admin',
                      {
                          type: Sequelize.DataTypes.BOOLEAN,

                            defaultValue: false,
                            allowNull: false,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'guarantor',
                      'full_name',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'guarantor',
                      'sex',
                      {
                          type: Sequelize.DataTypes.ENUM,

                            values: ['M','F'],

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'guarantor',
                      'date_of_birth',
                      {
                          type: Sequelize.DataTypes.DATE,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'guarantor',
                      'document_type',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'guarantor',
                      'document_number',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'guarantor',
                      'phone_number',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'guarantor',
                      'provinceId',
                      {
                          type: Sequelize.DataTypes.UUID,

                            references: {
                                model: 'provinces',
                                key: 'id',
                            },

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'guarantor',
                      'districtId',
                      {
                          type: Sequelize.DataTypes.UUID,

                            references: {
                                model: 'districts',
                                key: 'id',
                            },

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'guarantor',
                      'communeId',
                      {
                          type: Sequelize.DataTypes.UUID,

                            references: {
                                model: 'communes',
                                key: 'id',
                            },

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'guarantor',
                      'villageId',
                      {
                          type: Sequelize.DataTypes.UUID,

                            references: {
                                model: 'villages',
                                key: 'id',
                            },

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'guarantor',
                      'full_address_input',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'interest_rates',
                      'code',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'interest_rates',
                      'name',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'interest_rates',
                      'rate',
                      {
                          type: Sequelize.DataTypes.DECIMAL,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'interest_rates',
                      'commission_rate',
                      {
                          type: Sequelize.DataTypes.DECIMAL,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'interest_rates',
                      'interval',
                      {
                          type: Sequelize.DataTypes.INTEGER,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'interest_rates',
                      'sort',
                      {
                          type: Sequelize.DataTypes.INTEGER,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'interest_rates',
                      'css',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'interest_rates',
                      'setting',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'loan_status',
                      'name',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'loan_status',
                      'css',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'loan_types',
                      'name_kh',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'loan_types',
                      'name_en',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'loans',
                      'code',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'loans',
                      'principal_amount',
                      {
                          type: Sequelize.DataTypes.DECIMAL,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'loans',
                      'term',
                      {
                          type: Sequelize.DataTypes.INTEGER,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'loans',
                      'pending_amount',
                      {
                          type: Sequelize.DataTypes.DECIMAL,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'loans',
                      'last_pending_amount',
                      {
                          type: Sequelize.DataTypes.DECIMAL,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'loans',
                      'rate',
                      {
                          type: Sequelize.DataTypes.DECIMAL,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'loans',
                      'commission_rate',
                      {
                          type: Sequelize.DataTypes.DECIMAL,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'loans',
                      'registration_date',
                      {
                          type: Sequelize.DataTypes.DATE,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'loans',
                      'started_payment_date',
                      {
                          type: Sequelize.DataTypes.DATE,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'loans',
                      'last_payment_date',
                      {
                          type: Sequelize.DataTypes.DATE,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'loans',
                      'finish_payment_date',
                      {
                          type: Sequelize.DataTypes.DATE,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'loans',
                      'finish_discount',
                      {
                          type: Sequelize.DataTypes.DECIMAL,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'loans',
                      'finish_discount_amount',
                      {
                          type: Sequelize.DataTypes.DECIMAL,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'loans',
                      'admin_rate',
                      {
                          type: Sequelize.DataTypes.DECIMAL,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'loans',
                      'admin_amount',
                      {
                          type: Sequelize.DataTypes.DECIMAL,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'loans',
                      'purpose',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'loans',
                      'statusId',
                      {
                          type: Sequelize.DataTypes.UUID,

                            references: {
                                model: 'loan_status',
                                key: 'id',
                            },

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'loans',
                      'clientId',
                      {
                          type: Sequelize.DataTypes.UUID,

                            references: {
                                model: 'clients',
                                key: 'id',
                            },

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'loans',
                      'staffId',
                      {
                          type: Sequelize.DataTypes.UUID,

                            references: {
                                model: 'staffs',
                                key: 'id',
                            },

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'loans',
                      'interest_rateId',
                      {
                          type: Sequelize.DataTypes.UUID,

                            references: {
                                model: 'interest_rates',
                                key: 'id',
                            },

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'loans',
                      'branchId',
                      {
                          type: Sequelize.DataTypes.UUID,

                            references: {
                                model: 'branches',
                                key: 'id',
                            },

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'loans',
                      'loan_typeId',
                      {
                          type: Sequelize.DataTypes.UUID,

                            references: {
                                model: 'loan_types',
                                key: 'id',
                            },

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'members',
                      'name_kh',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'members',
                      'name_en',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'members',
                      'phone_number',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'members',
                      'sexId',
                      {
                          type: Sequelize.DataTypes.UUID,

                            references: {
                                model: 'sexes',
                                key: 'id',
                            },

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'menus',
                      'parentId',
                      {
                          type: Sequelize.DataTypes.UUID,

                            references: {
                                model: 'menus',
                                key: 'id',
                            },

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'menus',
                      'label',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'menus',
                      'url',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'menus',
                      'active_url',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'menus',
                      'permission',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'menus',
                      'icon',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'menus',
                      'urlId',
                      {
                          type: Sequelize.DataTypes.UUID,

                            references: {
                                model: 'urls',
                                key: 'id',
                            },

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'menus',
                      'groupId',
                      {
                          type: Sequelize.DataTypes.UUID,

                            references: {
                                model: 'group_menus',
                                key: 'id',
                            },

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'payment_revenues',
                      'transaction_date',
                      {
                          type: Sequelize.DataTypes.DATE,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'payment_revenues',
                      'admin_fee_amount',
                      {
                          type: Sequelize.DataTypes.DECIMAL,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'payment_revenues',
                      'interest_amount',
                      {
                          type: Sequelize.DataTypes.DECIMAL,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'payment_revenues',
                      'commission_amount',
                      {
                          type: Sequelize.DataTypes.DECIMAL,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'payment_revenues',
                      'expense_amount',
                      {
                          type: Sequelize.DataTypes.DECIMAL,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'payment_revenues',
                      'setlement_datetime',
                      {
                          type: Sequelize.DataTypes.DATE,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'payment_revenues',
                      'branchId',
                      {
                          type: Sequelize.DataTypes.UUID,

                            references: {
                                model: 'branches',
                                key: 'id',
                            },

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'payment_status',
                      'name',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'payment_status',
                      'css',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'payment_status',
                      'visible',
                      {
                          type: Sequelize.DataTypes.BOOLEAN,

                            defaultValue: false,
                            allowNull: false,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'payment_transactions',
                      'transaction_datetime',
                      {
                          type: Sequelize.DataTypes.DATE,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'payment_transactions',
                      'transaction_amount',
                      {
                          type: Sequelize.DataTypes.DECIMAL,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'payment_transactions',
                      'deduct_amount',
                      {
                          type: Sequelize.DataTypes.DECIMAL,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'payment_transactions',
                      'interest_amount',
                      {
                          type: Sequelize.DataTypes.DECIMAL,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'payment_transactions',
                      'commission_amount',
                      {
                          type: Sequelize.DataTypes.DECIMAL,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'payment_transactions',
                      'revenue_amount',
                      {
                          type: Sequelize.DataTypes.DECIMAL,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'payment_transactions',
                      'setlement_datetime',
                      {
                          type: Sequelize.DataTypes.DATE,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'payment_transactions',
                      'type',
                      {
                          type: Sequelize.DataTypes.ENUM,

                            values: ['interest','deduction','reverse'],

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'payment_transactions',
                      'paymentId',
                      {
                          type: Sequelize.DataTypes.UUID,

                            references: {
                                model: 'payments',
                                key: 'id',
                            },

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'payments',
                      'start_payment_date',
                      {
                          type: Sequelize.DataTypes.DATE,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'payments',
                      'payment_date',
                      {
                          type: Sequelize.DataTypes.DATE,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'payments',
                      'last_payment_paid_date',
                      {
                          type: Sequelize.DataTypes.DATE,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'payments',
                      'sort',
                      {
                          type: Sequelize.DataTypes.INTEGER,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'payments',
                      'deduct_amount',
                      {
                          type: Sequelize.DataTypes.DECIMAL,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'payments',
                      'deduct_paid_amount',
                      {
                          type: Sequelize.DataTypes.DECIMAL,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'payments',
                      'interval',
                      {
                          type: Sequelize.DataTypes.INTEGER,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'payments',
                      'interest_amount',
                      {
                          type: Sequelize.DataTypes.DECIMAL,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'payments',
                      'commission_amount',
                      {
                          type: Sequelize.DataTypes.DECIMAL,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'payments',
                      'total_amount',
                      {
                          type: Sequelize.DataTypes.DECIMAL,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'payments',
                      'total_paid_amount',
                      {
                          type: Sequelize.DataTypes.DECIMAL,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'payments',
                      'penalty_amount',
                      {
                          type: Sequelize.DataTypes.DECIMAL,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'payments',
                      'pending_amount',
                      {
                          type: Sequelize.DataTypes.DECIMAL,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'payments',
                      'cross_amount',
                      {
                          type: Sequelize.DataTypes.DECIMAL,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'payments',
                      'remark',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'payments',
                      'loanId',
                      {
                          type: Sequelize.DataTypes.UUID,

                            references: {
                                model: 'loans',
                                key: 'id',
                            },

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'payments',
                      'statusId',
                      {
                          type: Sequelize.DataTypes.UUID,

                            references: {
                                model: 'payment_status',
                                key: 'id',
                            },

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'provinces',
                      'name_kh',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'provinces',
                      'name_en',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'provinces',
                      'active',
                      {
                          type: Sequelize.DataTypes.BOOLEAN,

                            defaultValue: false,
                            allowNull: false,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'sexes',
                      'name',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'shareholders',
                      'name_en',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'shareholders',
                      'name_kh',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'shareholders',
                      'earn_rate',
                      {
                          type: Sequelize.DataTypes.DECIMAL,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'shareholders',
                      'date_of_birth',
                      {
                          type: Sequelize.DataTypes.DATE,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'shareholders',
                      'phone_number',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'shareholders',
                      'start_work_date',
                      {
                          type: Sequelize.DataTypes.DATE,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'shareholders',
                      'born_place',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'shareholders',
                      'document_type',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'shareholders',
                      'document_number',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'shareholders',
                      'emergency_number',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'shareholders',
                      'current_place',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'shareholders',
                      'sex',
                      {
                          type: Sequelize.DataTypes.ENUM,

                            values: ['M','F'],

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'staff_status',
                      'name',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'staff_status',
                      'css',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'staffs',
                      'name_en',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'staffs',
                      'name_kh',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'staffs',
                      'date_of_birth',
                      {
                          type: Sequelize.DataTypes.DATE,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'staffs',
                      'phone_number',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'staffs',
                      'start_work_date',
                      {
                          type: Sequelize.DataTypes.DATE,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'staffs',
                      'born_place',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'staffs',
                      'document_type',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'staffs',
                      'document_number',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'staffs',
                      'emergency_number',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'staffs',
                      'current_place',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'staffs',
                      'statusId',
                      {
                          type: Sequelize.DataTypes.UUID,

                            references: {
                                model: 'staff_status',
                                key: 'id',
                            },

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'staffs',
                      'sex',
                      {
                          type: Sequelize.DataTypes.ENUM,

                            values: ['M','F'],

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'staffs',
                      'branchId',
                      {
                          type: Sequelize.DataTypes.UUID,

                            references: {
                                model: 'branches',
                                key: 'id',
                            },

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'urls',
                      'method',
                      {
                          type: Sequelize.DataTypes.ENUM,

                            values: ['GET','POST','PATCH','DELETE'],

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'urls',
                      'uri',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'urls',
                      'route_name',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'urls',
                      'acitve',
                      {
                          type: Sequelize.DataTypes.BOOLEAN,

                            defaultValue: false,
                            allowNull: false,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'urls',
                      'is_menu',
                      {
                          type: Sequelize.DataTypes.BOOLEAN,

                            defaultValue: false,
                            allowNull: false,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'user_has_menu',
                      'userId',
                      {
                          type: Sequelize.DataTypes.UUID,

                            references: {
                                model: 'users',
                                key: 'id',
                            },

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'user_has_menu',
                      'menuId',
                      {
                          type: Sequelize.DataTypes.UUID,

                            references: {
                                model: 'menus',
                                key: 'id',
                            },

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'user_has_menu',
                      'status',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'user_type_urls',
                      'user_typeId',
                      {
                          type: Sequelize.DataTypes.UUID,

                            references: {
                                model: 'user_types',
                                key: 'id',
                            },

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'user_type_urls',
                      'urlId',
                      {
                          type: Sequelize.DataTypes.UUID,

                            references: {
                                model: 'urls',
                                key: 'id',
                            },

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'user_types',
                      'is_admin',
                      {
                          type: Sequelize.DataTypes.BOOLEAN,

                            defaultValue: false,
                            allowNull: false,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'user_types',
                      'name',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'villages',
                      'name_kh',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'villages',
                      'name_en',
                      {
                          type: Sequelize.DataTypes.TEXT,

                      },
                      { transaction }
                    );

                    await queryInterface.addColumn(
                      'villages',
                      'communeId',
                      {
                          type: Sequelize.DataTypes.UUID,

                            references: {
                                model: 'communes',
                                key: 'id',
                            },

                      },
                      { transaction }
                    );

            await transaction.commit();
        } catch (err) {
            await transaction.rollback();
            throw err;
        }
    },
    /**
     * @param {QueryInterface} queryInterface
     * @param {Sequelize} Sequelize
     * @returns {Promise<void>}
     */
    async down(queryInterface, Sequelize) {
        /**
         * @type {Transaction}
         */
        const transaction = await queryInterface.sequelize.transaction();
        try {

                    await queryInterface.removeColumn(
                        'villages',
                        'communeId',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'villages',
                        'name_en',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'villages',
                        'name_kh',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'user_types',
                        'name',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'user_types',
                        'is_admin',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'user_type_urls',
                        'urlId',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'user_type_urls',
                        'user_typeId',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'user_has_menu',
                        'status',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'user_has_menu',
                        'menuId',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'user_has_menu',
                        'userId',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'urls',
                        'is_menu',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'urls',
                        'acitve',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'urls',
                        'route_name',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'urls',
                        'uri',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'urls',
                        'method',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'staffs',
                        'branchId',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'staffs',
                        'sex',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'staffs',
                        'statusId',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'staffs',
                        'current_place',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'staffs',
                        'emergency_number',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'staffs',
                        'document_number',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'staffs',
                        'document_type',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'staffs',
                        'born_place',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'staffs',
                        'start_work_date',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'staffs',
                        'phone_number',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'staffs',
                        'date_of_birth',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'staffs',
                        'name_kh',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'staffs',
                        'name_en',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'staff_status',
                        'css',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'staff_status',
                        'name',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'shareholders',
                        'sex',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'shareholders',
                        'current_place',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'shareholders',
                        'emergency_number',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'shareholders',
                        'document_number',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'shareholders',
                        'document_type',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'shareholders',
                        'born_place',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'shareholders',
                        'start_work_date',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'shareholders',
                        'phone_number',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'shareholders',
                        'date_of_birth',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'shareholders',
                        'earn_rate',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'shareholders',
                        'name_kh',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'shareholders',
                        'name_en',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'sexes',
                        'name',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'provinces',
                        'active',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'provinces',
                        'name_en',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'provinces',
                        'name_kh',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'payments',
                        'statusId',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'payments',
                        'loanId',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'payments',
                        'remark',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'payments',
                        'cross_amount',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'payments',
                        'pending_amount',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'payments',
                        'penalty_amount',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'payments',
                        'total_paid_amount',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'payments',
                        'total_amount',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'payments',
                        'commission_amount',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'payments',
                        'interest_amount',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'payments',
                        'interval',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'payments',
                        'deduct_paid_amount',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'payments',
                        'deduct_amount',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'payments',
                        'sort',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'payments',
                        'last_payment_paid_date',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'payments',
                        'payment_date',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'payments',
                        'start_payment_date',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'payment_transactions',
                        'paymentId',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'payment_transactions',
                        'type',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'payment_transactions',
                        'setlement_datetime',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'payment_transactions',
                        'revenue_amount',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'payment_transactions',
                        'commission_amount',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'payment_transactions',
                        'interest_amount',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'payment_transactions',
                        'deduct_amount',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'payment_transactions',
                        'transaction_amount',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'payment_transactions',
                        'transaction_datetime',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'payment_status',
                        'visible',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'payment_status',
                        'css',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'payment_status',
                        'name',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'payment_revenues',
                        'branchId',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'payment_revenues',
                        'setlement_datetime',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'payment_revenues',
                        'expense_amount',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'payment_revenues',
                        'commission_amount',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'payment_revenues',
                        'interest_amount',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'payment_revenues',
                        'admin_fee_amount',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'payment_revenues',
                        'transaction_date',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'menus',
                        'groupId',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'menus',
                        'urlId',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'menus',
                        'icon',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'menus',
                        'permission',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'menus',
                        'active_url',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'menus',
                        'url',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'menus',
                        'label',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'menus',
                        'parentId',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'members',
                        'sexId',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'members',
                        'phone_number',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'members',
                        'name_en',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'members',
                        'name_kh',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'loans',
                        'loan_typeId',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'loans',
                        'branchId',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'loans',
                        'interest_rateId',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'loans',
                        'staffId',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'loans',
                        'clientId',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'loans',
                        'statusId',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'loans',
                        'purpose',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'loans',
                        'admin_amount',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'loans',
                        'admin_rate',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'loans',
                        'finish_discount_amount',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'loans',
                        'finish_discount',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'loans',
                        'finish_payment_date',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'loans',
                        'last_payment_date',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'loans',
                        'started_payment_date',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'loans',
                        'registration_date',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'loans',
                        'commission_rate',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'loans',
                        'rate',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'loans',
                        'last_pending_amount',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'loans',
                        'pending_amount',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'loans',
                        'term',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'loans',
                        'principal_amount',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'loans',
                        'code',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'loan_types',
                        'name_en',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'loan_types',
                        'name_kh',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'loan_status',
                        'css',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'loan_status',
                        'name',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'interest_rates',
                        'setting',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'interest_rates',
                        'css',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'interest_rates',
                        'sort',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'interest_rates',
                        'interval',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'interest_rates',
                        'commission_rate',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'interest_rates',
                        'rate',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'interest_rates',
                        'name',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'interest_rates',
                        'code',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'guarantor',
                        'full_address_input',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'guarantor',
                        'villageId',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'guarantor',
                        'communeId',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'guarantor',
                        'districtId',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'guarantor',
                        'provinceId',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'guarantor',
                        'phone_number',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'guarantor',
                        'document_number',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'guarantor',
                        'document_type',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'guarantor',
                        'date_of_birth',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'guarantor',
                        'sex',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'guarantor',
                        'full_name',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'group_menus',
                        'is_admin',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'group_menus',
                        'name',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'expense_types',
                        'name_en',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'expense_types',
                        'name_kh',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'expense_items',
                        'branchId',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'expense_items',
                        'expense_typeId',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'expense_items',
                        'expense_amount',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'expense_items',
                        'description',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'expense_items',
                        'expense_datetime',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'document_type',
                        'name',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'districts',
                        'provinceId',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'districts',
                        'name_en',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'districts',
                        'name_kh',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'deposits',
                        'branchId',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'deposits',
                        'shareholderId',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'deposits',
                        'deposit_amount',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'deposits',
                        'deposit_datetime',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'communes',
                        'districtId',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'communes',
                        'name_en',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'communes',
                        'name_kh',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'clients',
                        'branchId',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'clients',
                        'villageId',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'clients',
                        'communeId',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'clients',
                        'districtId',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'clients',
                        'provinceId',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'clients',
                        'userId',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'clients',
                        'statusId',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'clients',
                        'sex',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'clients',
                        'document_number',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'clients',
                        'document_typeId',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'clients',
                        'is_new',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'clients',
                        'phone_number',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'clients',
                        'date_of_birth',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'clients',
                        'name_kh',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'clients',
                        'name_en',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'clients',
                        'code',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'client_status',
                        'name',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'calendars',
                        'flag',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'calendars',
                        'description',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'calendars',
                        'is_holiday',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'calendars',
                        'is_weekend',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'calendars',
                        'date',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'branches',
                        'description',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'branches',
                        'name',
                        { transaction }
                    );

                    await queryInterface.removeColumn(
                        'branches',
                        'code',
                        { 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('villages', { transaction });

                    await queryInterface.dropTable('user_types', { transaction });

                    await queryInterface.dropTable('user_type_urls', { transaction });

                    await queryInterface.dropTable('user_has_menu', { transaction });

                    await queryInterface.dropTable('urls', { transaction });

                    await queryInterface.dropTable('staffs', { transaction });

                    await queryInterface.dropTable('staff_status', { transaction });

                    await queryInterface.dropTable('shareholders', { transaction });

                    await queryInterface.dropTable('sexes', { transaction });

                    await queryInterface.dropTable('provinces', { transaction });

                    await queryInterface.dropTable('payments', { transaction });

                    await queryInterface.dropTable('payment_transactions', { transaction });

                    await queryInterface.dropTable('payment_status', { transaction });

                    await queryInterface.dropTable('payment_revenues', { transaction });

                    await queryInterface.dropTable('menus', { transaction });

                    await queryInterface.dropTable('members', { transaction });

                    await queryInterface.dropTable('loans', { transaction });

                    await queryInterface.dropTable('loan_types', { transaction });

                    await queryInterface.dropTable('loan_status', { transaction });

                    await queryInterface.dropTable('interest_rates', { transaction });

                    await queryInterface.dropTable('guarantor', { transaction });

                    await queryInterface.dropTable('group_menus', { transaction });

                    await queryInterface.dropTable('expense_types', { transaction });

                    await queryInterface.dropTable('expense_items', { transaction });

                    await queryInterface.dropTable('document_type', { transaction });

                    await queryInterface.dropTable('districts', { transaction });

                    await queryInterface.dropTable('deposits', { transaction });

                    await queryInterface.dropTable('communes', { transaction });

                    await queryInterface.dropTable('clients', { transaction });

                    await queryInterface.dropTable('client_status', { transaction });

                    await queryInterface.dropTable('calendars', { transaction });

                    await queryInterface.dropTable('branches', { transaction });

                    await queryInterface.dropTable('users', { transaction });

            await transaction.commit();
        } catch (err) {
            await transaction.rollback();
            throw err;
        }
    }
};
