module.exports = {
    /**
     * @param {QueryInterface} queryInterface
     * @param {Sequelize} Sequelize
     * @returns {Promise<void>}
     */
    async up(queryInterface, Sequelize) {
        /**
         * @type {Transaction}
         */
        const transaction = await queryInterface.sequelize.transaction();
        try {
            
                
                    await queryInterface.createTable('users', {
                        id: {
                            type: Sequelize.DataTypes.UUID,
                            defaultValue: Sequelize.DataTypes.UUIDV4,
                            primaryKey: true,
                        },
                        createdById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        updatedById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        createdAt: { type: Sequelize.DataTypes.DATE },
                        updatedAt: { type: Sequelize.DataTypes.DATE },
                        deletedAt: { type: Sequelize.DataTypes.DATE },
                        importHash: {
                            type: Sequelize.DataTypes.STRING(255),
                            allowNull: true,
                          unique: true, 
                        },
                    }, { transaction });
                
            
                
                    await queryInterface.createTable('roles', {
                        id: {
                            type: Sequelize.DataTypes.UUID,
                            defaultValue: Sequelize.DataTypes.UUIDV4,
                            primaryKey: true,
                        },
                        createdById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        updatedById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        createdAt: { type: Sequelize.DataTypes.DATE },
                        updatedAt: { type: Sequelize.DataTypes.DATE },
                        deletedAt: { type: Sequelize.DataTypes.DATE },
                        importHash: {
                            type: Sequelize.DataTypes.STRING(255),
                            allowNull: true,
                          unique: true, 
                        },
                    }, { transaction });
                
            
                
                    await queryInterface.createTable('permissions', {
                        id: {
                            type: Sequelize.DataTypes.UUID,
                            defaultValue: Sequelize.DataTypes.UUIDV4,
                            primaryKey: true,
                        },
                        createdById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        updatedById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        createdAt: { type: Sequelize.DataTypes.DATE },
                        updatedAt: { type: Sequelize.DataTypes.DATE },
                        deletedAt: { type: Sequelize.DataTypes.DATE },
                        importHash: {
                            type: Sequelize.DataTypes.STRING(255),
                            allowNull: true,
                          unique: true, 
                        },
                    }, { transaction });
                
            
                
                    await queryInterface.createTable('account_approvals', {
                        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('restaurants', {
                        id: {
                            type: Sequelize.DataTypes.UUID,
                            defaultValue: Sequelize.DataTypes.UUIDV4,
                            primaryKey: true,
                        },
                        createdById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        updatedById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        createdAt: { type: Sequelize.DataTypes.DATE },
                        updatedAt: { type: Sequelize.DataTypes.DATE },
                        deletedAt: { type: Sequelize.DataTypes.DATE },
                        importHash: {
                            type: Sequelize.DataTypes.STRING(255),
                            allowNull: true,
                          unique: true, 
                        },
                    }, { transaction });
                
            
                
                    await queryInterface.createTable('restaurant_tables', {
                        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('work_schedules', {
                        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('work_shifts', {
                        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('attendance_events', {
                        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('geofence_alerts', {
                        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('menu_categories', {
                        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('menu_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('orders', {
                        id: {
                            type: Sequelize.DataTypes.UUID,
                            defaultValue: Sequelize.DataTypes.UUIDV4,
                            primaryKey: true,
                        },
                        createdById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        updatedById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        createdAt: { type: Sequelize.DataTypes.DATE },
                        updatedAt: { type: Sequelize.DataTypes.DATE },
                        deletedAt: { type: Sequelize.DataTypes.DATE },
                        importHash: {
                            type: Sequelize.DataTypes.STRING(255),
                            allowNull: true,
                          unique: true, 
                        },
                    }, { transaction });
                
            
                
                    await queryInterface.createTable('order_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('reservations', {
                        id: {
                            type: Sequelize.DataTypes.UUID,
                            defaultValue: Sequelize.DataTypes.UUIDV4,
                            primaryKey: true,
                        },
                        createdById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        updatedById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        createdAt: { type: Sequelize.DataTypes.DATE },
                        updatedAt: { type: Sequelize.DataTypes.DATE },
                        deletedAt: { type: Sequelize.DataTypes.DATE },
                        importHash: {
                            type: Sequelize.DataTypes.STRING(255),
                            allowNull: true,
                          unique: true, 
                        },
                    }, { transaction });
                
            
                
                    await queryInterface.createTable('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('loyalty_accounts', {
                        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('loyalty_rules', {
                        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('loyalty_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('customer_reviews', {
                        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('notification_events', {
                        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('stock_locations', {
                        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('stock_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('stock_movements', {
                        id: {
                            type: Sequelize.DataTypes.UUID,
                            defaultValue: Sequelize.DataTypes.UUIDV4,
                            primaryKey: true,
                        },
                        createdById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        updatedById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        createdAt: { type: Sequelize.DataTypes.DATE },
                        updatedAt: { type: Sequelize.DataTypes.DATE },
                        deletedAt: { type: Sequelize.DataTypes.DATE },
                        importHash: {
                            type: Sequelize.DataTypes.STRING(255),
                            allowNull: true,
                          unique: true, 
                        },
                    }, { transaction });
                
            
                
                    await queryInterface.createTable('invoices', {
                        id: {
                            type: Sequelize.DataTypes.UUID,
                            defaultValue: Sequelize.DataTypes.UUIDV4,
                            primaryKey: true,
                        },
                        createdById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        updatedById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        createdAt: { type: Sequelize.DataTypes.DATE },
                        updatedAt: { type: Sequelize.DataTypes.DATE },
                        deletedAt: { type: Sequelize.DataTypes.DATE },
                        importHash: {
                            type: Sequelize.DataTypes.STRING(255),
                            allowNull: true,
                          unique: true, 
                        },
                    }, { transaction });
                
            
                
                    await queryInterface.createTable('audit_logs', {
                        id: {
                            type: Sequelize.DataTypes.UUID,
                            defaultValue: Sequelize.DataTypes.UUIDV4,
                            primaryKey: true,
                        },
                        createdById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        updatedById: {
                            type: Sequelize.DataTypes.UUID,
                            references: {
                                key: 'id',
                                model: 'users',
                            },
                        },
                        createdAt: { type: Sequelize.DataTypes.DATE },
                        updatedAt: { type: Sequelize.DataTypes.DATE },
                        deletedAt: { type: Sequelize.DataTypes.DATE },
                        importHash: {
                            type: Sequelize.DataTypes.STRING(255),
                            allowNull: true,
                          unique: true, 
                        },
                    }, { transaction });
                
            
                
                    
                    await queryInterface.addColumn(
                      'users',
                      'firstName',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'users',
                      'lastName',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'users',
                      'phoneNumber',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'users',
                      'email',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'users',
                      'disabled',
                      {
                          type: Sequelize.DataTypes.BOOLEAN,
                          
                            defaultValue: false,
                            allowNull: false,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
            
                
                    
                    await queryInterface.addColumn(
                      'users',
                      'password',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'users',
                      'emailVerified',
                      {
                          type: Sequelize.DataTypes.BOOLEAN,
                          
                            defaultValue: false,
                            allowNull: false,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'users',
                      'emailVerificationToken',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'users',
                      'emailVerificationTokenExpiresAt',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'users',
                      'passwordResetToken',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'users',
                      'passwordResetTokenExpiresAt',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'users',
                      'provider',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'users',
                      'app_roleId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'roles',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
            
                
                    
                    await queryInterface.addColumn(
                      'roles',
                      'name',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'roles',
                      'role_customization',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
            
                
                    
                    await queryInterface.addColumn(
                      'permissions',
                      'name',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'account_approvals',
                      'candidate_userId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'users',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'account_approvals',
                      'requested_by_userId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'users',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'account_approvals',
                      'reviewed_by_userId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'users',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'account_approvals',
                      'status',
                      {
                          type: Sequelize.DataTypes.ENUM,
                          
                          
                            values: ['en_attente','approuve','rejete'],
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'account_approvals',
                      'requested_at',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'account_approvals',
                      'reviewed_at',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'account_approvals',
                      'review_comment',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'restaurants',
                      'name',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'restaurants',
                      'address',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'restaurants',
                      'contact_phone',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'restaurants',
                      'staff_count_planned',
                      {
                          type: Sequelize.DataTypes.INTEGER,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'restaurants',
                      'table_count',
                      {
                          type: Sequelize.DataTypes.INTEGER,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'restaurants',
                      'opening_time',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'restaurants',
                      'closing_time',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'restaurants',
                      'latitude',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'restaurants',
                      'longitude',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'restaurants',
                      'geofence_radius_meters',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'restaurants',
                      'is_active',
                      {
                          type: Sequelize.DataTypes.BOOLEAN,
                          
                            defaultValue: false,
                            allowNull: false,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'restaurant_tables',
                      'restaurantId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'restaurants',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'restaurant_tables',
                      'table_label',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'restaurant_tables',
                      'seat_count',
                      {
                          type: Sequelize.DataTypes.INTEGER,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'restaurant_tables',
                      'qr_payload',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
            
                
                    
                    await queryInterface.addColumn(
                      'restaurant_tables',
                      'is_available',
                      {
                          type: Sequelize.DataTypes.BOOLEAN,
                          
                            defaultValue: false,
                            allowNull: false,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'work_schedules',
                      'restaurantId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'restaurants',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'work_schedules',
                      'created_by_userId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'users',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'work_schedules',
                      'title',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'work_schedules',
                      'period_start',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'work_schedules',
                      'period_end',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'work_schedules',
                      'status',
                      {
                          type: Sequelize.DataTypes.ENUM,
                          
                          
                            values: ['brouillon','publie','archive'],
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'work_schedules',
                      'notes',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'work_shifts',
                      'work_scheduleId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'work_schedules',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'work_shifts',
                      'staff_userId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'users',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'work_shifts',
                      'shift_start',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'work_shifts',
                      'shift_end',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'work_shifts',
                      'shift_role',
                      {
                          type: Sequelize.DataTypes.ENUM,
                          
                          
                            values: ['superviseur','chef_cuisinier','cuisinier','caissier','barman','serveur','agent_entretien'],
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'work_shifts',
                      'shift_status',
                      {
                          type: Sequelize.DataTypes.ENUM,
                          
                          
                            values: ['planifie','confirme','annule'],
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'work_shifts',
                      'shift_notes',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'attendance_events',
                      'restaurantId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'restaurants',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'attendance_events',
                      'staff_userId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'users',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'attendance_events',
                      'work_shiftId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'work_shifts',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'attendance_events',
                      'event_type',
                      {
                          type: Sequelize.DataTypes.ENUM,
                          
                          
                            values: ['check_in','check_out','absence','retard'],
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'attendance_events',
                      'event_time',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'attendance_events',
                      'latitude',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'attendance_events',
                      'longitude',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'attendance_events',
                      'distance_meters',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'attendance_events',
                      'out_of_geofence',
                      {
                          type: Sequelize.DataTypes.BOOLEAN,
                          
                            defaultValue: false,
                            allowNull: false,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'attendance_events',
                      'comment',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'geofence_alerts',
                      'restaurantId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'restaurants',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'geofence_alerts',
                      'staff_userId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'users',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'geofence_alerts',
                      'distance_meters',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'geofence_alerts',
                      'latitude',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'geofence_alerts',
                      'longitude',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'geofence_alerts',
                      'alert_time',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'geofence_alerts',
                      'severity',
                      {
                          type: Sequelize.DataTypes.ENUM,
                          
                          
                            values: ['info','warning','critical'],
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'geofence_alerts',
                      'is_acknowledged',
                      {
                          type: Sequelize.DataTypes.BOOLEAN,
                          
                            defaultValue: false,
                            allowNull: false,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'geofence_alerts',
                      'acknowledged_by_userId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'users',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'menu_categories',
                      'restaurantId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'restaurants',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'menu_categories',
                      'name',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'menu_categories',
                      'category_type',
                      {
                          type: Sequelize.DataTypes.ENUM,
                          
                          
                            values: ['nourriture','boisson'],
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'menu_categories',
                      'description',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'menu_categories',
                      'sort_order',
                      {
                          type: Sequelize.DataTypes.INTEGER,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'menu_categories',
                      'is_active',
                      {
                          type: Sequelize.DataTypes.BOOLEAN,
                          
                            defaultValue: false,
                            allowNull: false,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'menu_items',
                      'restaurantId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'restaurants',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'menu_items',
                      'menu_categoryId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'menu_categories',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'menu_items',
                      'name',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'menu_items',
                      'description',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'menu_items',
                      'item_type',
                      {
                          type: Sequelize.DataTypes.ENUM,
                          
                          
                            values: ['nourriture','boisson'],
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'menu_items',
                      'price',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
            
                
                    
                    await queryInterface.addColumn(
                      'menu_items',
                      'is_available',
                      {
                          type: Sequelize.DataTypes.BOOLEAN,
                          
                            defaultValue: false,
                            allowNull: false,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'menu_items',
                      'prep_time_minutes',
                      {
                          type: Sequelize.DataTypes.INTEGER,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'orders',
                      'restaurantId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'restaurants',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'orders',
                      'client_userId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'users',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'orders',
                      'tableId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'restaurant_tables',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'orders',
                      'order_channel',
                      {
                          type: Sequelize.DataTypes.ENUM,
                          
                          
                            values: ['sur_place_qr','a_distance'],
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'orders',
                      'fulfillment_type',
                      {
                          type: Sequelize.DataTypes.ENUM,
                          
                          
                            values: ['sur_place','emporter','livraison'],
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'orders',
                      'delivery_address',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'orders',
                      'delivery_latitude',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'orders',
                      'delivery_longitude',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'orders',
                      'status',
                      {
                          type: Sequelize.DataTypes.ENUM,
                          
                          
                            values: ['brouillon','validee','en_preparation','prete','servie','annulee'],
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'orders',
                      'ordered_at',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'orders',
                      'requested_for',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'orders',
                      'customer_note',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'orders',
                      'subtotal_amount',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'orders',
                      'total_amount',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'orders',
                      'is_paid',
                      {
                          type: Sequelize.DataTypes.BOOLEAN,
                          
                            defaultValue: false,
                            allowNull: false,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'order_items',
                      'orderId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'orders',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'order_items',
                      'menu_itemId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'menu_items',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'order_items',
                      'quantity',
                      {
                          type: Sequelize.DataTypes.INTEGER,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'order_items',
                      'unit_price',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'order_items',
                      'line_total',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'order_items',
                      'special_instructions',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'order_items',
                      'item_status',
                      {
                          type: Sequelize.DataTypes.ENUM,
                          
                          
                            values: ['en_attente','en_preparation','prete','servie','annule'],
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'reservations',
                      'restaurantId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'restaurants',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'reservations',
                      'client_userId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'users',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'reservations',
                      'tableId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'restaurant_tables',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'reservations',
                      'start_time',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'reservations',
                      'end_time',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'reservations',
                      'party_size',
                      {
                          type: Sequelize.DataTypes.INTEGER,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'reservations',
                      'status',
                      {
                          type: Sequelize.DataTypes.ENUM,
                          
                          
                            values: ['en_attente','confirmee','honoree','annulee','no_show'],
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'reservations',
                      'note',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'payments',
                      'restaurantId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'restaurants',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'payments',
                      'orderId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'orders',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'payments',
                      'client_userId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'users',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'payments',
                      'payment_method',
                      {
                          type: Sequelize.DataTypes.ENUM,
                          
                          
                            values: ['espece','orange_money','mtn_mobile_money','moov_money','wave','visa','mastercard'],
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'payments',
                      'status',
                      {
                          type: Sequelize.DataTypes.ENUM,
                          
                          
                            values: ['initie','reussi','echoue','rembourse'],
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'payments',
                      'amount',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'payments',
                      'paid_at',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'payments',
                      'provider_reference',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
            
                
                    
                    await queryInterface.addColumn(
                      'payments',
                      'receipt_text',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'payments',
                      'points_earned',
                      {
                          type: Sequelize.DataTypes.INTEGER,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'loyalty_accounts',
                      'client_userId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'users',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'loyalty_accounts',
                      'points_balance',
                      {
                          type: Sequelize.DataTypes.INTEGER,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'loyalty_accounts',
                      'last_activity_at',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'loyalty_rules',
                      'name',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'loyalty_rules',
                      'reward_type',
                      {
                          type: Sequelize.DataTypes.ENUM,
                          
                          
                            values: ['reduction','ticket_tombola'],
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'loyalty_rules',
                      'points_to_value_rate',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'loyalty_rules',
                      'max_discount_amount',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'loyalty_rules',
                      'starts_at',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'loyalty_rules',
                      'ends_at',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'loyalty_rules',
                      'is_active',
                      {
                          type: Sequelize.DataTypes.BOOLEAN,
                          
                            defaultValue: false,
                            allowNull: false,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'loyalty_rules',
                      'description',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'loyalty_transactions',
                      'loyalty_accountId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'loyalty_accounts',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'loyalty_transactions',
                      'paymentId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'payments',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'loyalty_transactions',
                      'transaction_type',
                      {
                          type: Sequelize.DataTypes.ENUM,
                          
                          
                            values: ['gain','utilisation','ajustement'],
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'loyalty_transactions',
                      'points',
                      {
                          type: Sequelize.DataTypes.INTEGER,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'loyalty_transactions',
                      'transaction_time',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'loyalty_transactions',
                      'description',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'customer_reviews',
                      'restaurantId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'restaurants',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'customer_reviews',
                      'client_userId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'users',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'customer_reviews',
                      'orderId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'orders',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'customer_reviews',
                      'rating',
                      {
                          type: Sequelize.DataTypes.INTEGER,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'customer_reviews',
                      'comment',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'customer_reviews',
                      'reviewed_at',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'customer_reviews',
                      'is_published',
                      {
                          type: Sequelize.DataTypes.BOOLEAN,
                          
                            defaultValue: false,
                            allowNull: false,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'notification_events',
                      'restaurantId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'restaurants',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'notification_events',
                      'event_type',
                      {
                          type: Sequelize.DataTypes.ENUM,
                          
                          
                            values: ['commande','paiement','reservation','avis','stock','geofence'],
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'notification_events',
                      'audience',
                      {
                          type: Sequelize.DataTypes.ENUM,
                          
                          
                            values: ['admins','personnel','client','role_cible','utilisateur_cible'],
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'notification_events',
                      'order_nature',
                      {
                          type: Sequelize.DataTypes.ENUM,
                          
                          
                            values: ['nourriture','boisson','mixte','na'],
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'notification_events',
                      'quantity_total',
                      {
                          type: Sequelize.DataTypes.INTEGER,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'notification_events',
                      'title',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'notification_events',
                      'message',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'notification_events',
                      'event_time',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'notification_events',
                      'is_read',
                      {
                          type: Sequelize.DataTypes.BOOLEAN,
                          
                            defaultValue: false,
                            allowNull: false,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'notification_events',
                      'target_userId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'users',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'stock_locations',
                      'restaurantId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'restaurants',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'stock_locations',
                      'location_type',
                      {
                          type: Sequelize.DataTypes.ENUM,
                          
                          
                            values: ['cuisine','bar','entretien'],
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'stock_locations',
                      'name',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'stock_locations',
                      'is_active',
                      {
                          type: Sequelize.DataTypes.BOOLEAN,
                          
                            defaultValue: false,
                            allowNull: false,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'stock_items',
                      'stock_locationId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'stock_locations',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'stock_items',
                      'name',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'stock_items',
                      'category',
                      {
                          type: Sequelize.DataTypes.ENUM,
                          
                          
                            values: ['nourriture','boisson','produit_entretien','autre'],
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'stock_items',
                      'unit',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'stock_items',
                      'quantity_on_hand',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'stock_items',
                      'reorder_threshold',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'stock_items',
                      'is_active',
                      {
                          type: Sequelize.DataTypes.BOOLEAN,
                          
                            defaultValue: false,
                            allowNull: false,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'stock_items',
                      'notes',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'stock_movements',
                      'stock_itemId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'stock_items',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'stock_movements',
                      'restaurantId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'restaurants',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'stock_movements',
                      'performed_by_userId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'users',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'stock_movements',
                      'movement_type',
                      {
                          type: Sequelize.DataTypes.ENUM,
                          
                          
                            values: ['entree','sortie','ajustement'],
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'stock_movements',
                      'quantity',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'stock_movements',
                      'movement_time',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'stock_movements',
                      'reason',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'invoices',
                      'restaurantId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'restaurants',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'invoices',
                      'orderId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'orders',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'invoices',
                      'client_userId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'users',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'invoices',
                      'invoice_number',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'invoices',
                      'status',
                      {
                          type: Sequelize.DataTypes.ENUM,
                          
                          
                            values: ['ouverte','payee','annulee','remboursee'],
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'invoices',
                      'subtotal_amount',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'invoices',
                      'total_amount',
                      {
                          type: Sequelize.DataTypes.DECIMAL,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'invoices',
                      'issued_at',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'invoices',
                      'closed_at',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'audit_logs',
                      'actor_userId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'users',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'audit_logs',
                      'restaurantId',
                      {
                          type: Sequelize.DataTypes.UUID,
                          
                          
                          
                            references: {
                                model: 'restaurants',
                                key: 'id',
                            },
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'audit_logs',
                      'action',
                      {
                          type: Sequelize.DataTypes.ENUM,
                          
                          
                            values: ['create','update','delete','suspend','approve','reject','login','logout','other'],
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'audit_logs',
                      'entity_name',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'audit_logs',
                      'entity_ref',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'audit_logs',
                      'action_time',
                      {
                          type: Sequelize.DataTypes.DATE,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
                
                    
                    await queryInterface.addColumn(
                      'audit_logs',
                      'details',
                      {
                          type: Sequelize.DataTypes.TEXT,
                          
                          
                          
                      },
                      { transaction }
                    );
                
            
            
            
            await transaction.commit();
        } catch (err) {
            await transaction.rollback();
            throw err;
        }
    },
    /**
     * @param {QueryInterface} queryInterface
     * @param {Sequelize} Sequelize
     * @returns {Promise<void>}
     */
    async down(queryInterface, Sequelize) {
        /**
         * @type {Transaction}
         */
        const transaction = await queryInterface.sequelize.transaction();
        try {
            
                
                    await queryInterface.removeColumn(
                        'audit_logs',
                        'details',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'audit_logs',
                        'action_time',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'audit_logs',
                        'entity_ref',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'audit_logs',
                        'entity_name',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'audit_logs',
                        'action',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'audit_logs',
                        'restaurantId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'audit_logs',
                        'actor_userId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'invoices',
                        'closed_at',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'invoices',
                        'issued_at',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'invoices',
                        'total_amount',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'invoices',
                        'subtotal_amount',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'invoices',
                        'status',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'invoices',
                        'invoice_number',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'invoices',
                        'client_userId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'invoices',
                        'orderId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'invoices',
                        'restaurantId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'stock_movements',
                        'reason',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'stock_movements',
                        'movement_time',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'stock_movements',
                        'quantity',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'stock_movements',
                        'movement_type',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'stock_movements',
                        'performed_by_userId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'stock_movements',
                        'restaurantId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'stock_movements',
                        'stock_itemId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'stock_items',
                        'notes',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'stock_items',
                        'is_active',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'stock_items',
                        'reorder_threshold',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'stock_items',
                        'quantity_on_hand',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'stock_items',
                        'unit',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'stock_items',
                        'category',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'stock_items',
                        'name',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'stock_items',
                        'stock_locationId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'stock_locations',
                        'is_active',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'stock_locations',
                        'name',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'stock_locations',
                        'location_type',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'stock_locations',
                        'restaurantId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'notification_events',
                        'target_userId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'notification_events',
                        'is_read',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'notification_events',
                        'event_time',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'notification_events',
                        'message',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'notification_events',
                        'title',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'notification_events',
                        'quantity_total',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'notification_events',
                        'order_nature',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'notification_events',
                        'audience',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'notification_events',
                        'event_type',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'notification_events',
                        'restaurantId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'customer_reviews',
                        'is_published',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'customer_reviews',
                        'reviewed_at',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'customer_reviews',
                        'comment',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'customer_reviews',
                        'rating',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'customer_reviews',
                        'orderId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'customer_reviews',
                        'client_userId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'customer_reviews',
                        'restaurantId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'loyalty_transactions',
                        'description',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'loyalty_transactions',
                        'transaction_time',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'loyalty_transactions',
                        'points',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'loyalty_transactions',
                        'transaction_type',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'loyalty_transactions',
                        'paymentId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'loyalty_transactions',
                        'loyalty_accountId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'loyalty_rules',
                        'description',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'loyalty_rules',
                        'is_active',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'loyalty_rules',
                        'ends_at',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'loyalty_rules',
                        'starts_at',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'loyalty_rules',
                        'max_discount_amount',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'loyalty_rules',
                        'points_to_value_rate',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'loyalty_rules',
                        'reward_type',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'loyalty_rules',
                        'name',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'loyalty_accounts',
                        'last_activity_at',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'loyalty_accounts',
                        'points_balance',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'loyalty_accounts',
                        'client_userId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'payments',
                        'points_earned',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'payments',
                        'receipt_text',
                        { transaction }
                    );
                
            
                
            
                
                    await queryInterface.removeColumn(
                        'payments',
                        'provider_reference',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'payments',
                        'paid_at',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'payments',
                        'amount',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'payments',
                        'status',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'payments',
                        'payment_method',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'payments',
                        'client_userId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'payments',
                        'orderId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'payments',
                        'restaurantId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'reservations',
                        'note',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'reservations',
                        'status',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'reservations',
                        'party_size',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'reservations',
                        'end_time',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'reservations',
                        'start_time',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'reservations',
                        'tableId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'reservations',
                        'client_userId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'reservations',
                        'restaurantId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'order_items',
                        'item_status',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'order_items',
                        'special_instructions',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'order_items',
                        'line_total',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'order_items',
                        'unit_price',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'order_items',
                        'quantity',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'order_items',
                        'menu_itemId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'order_items',
                        'orderId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'orders',
                        'is_paid',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'orders',
                        'total_amount',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'orders',
                        'subtotal_amount',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'orders',
                        'customer_note',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'orders',
                        'requested_for',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'orders',
                        'ordered_at',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'orders',
                        'status',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'orders',
                        'delivery_longitude',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'orders',
                        'delivery_latitude',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'orders',
                        'delivery_address',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'orders',
                        'fulfillment_type',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'orders',
                        'order_channel',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'orders',
                        'tableId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'orders',
                        'client_userId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'orders',
                        'restaurantId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'menu_items',
                        'prep_time_minutes',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'menu_items',
                        'is_available',
                        { transaction }
                    );
                
            
                
            
                
                    await queryInterface.removeColumn(
                        'menu_items',
                        'price',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'menu_items',
                        'item_type',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'menu_items',
                        'description',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'menu_items',
                        'name',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'menu_items',
                        'menu_categoryId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'menu_items',
                        'restaurantId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'menu_categories',
                        'is_active',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'menu_categories',
                        'sort_order',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'menu_categories',
                        'description',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'menu_categories',
                        'category_type',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'menu_categories',
                        'name',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'menu_categories',
                        'restaurantId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'geofence_alerts',
                        'acknowledged_by_userId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'geofence_alerts',
                        'is_acknowledged',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'geofence_alerts',
                        'severity',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'geofence_alerts',
                        'alert_time',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'geofence_alerts',
                        'longitude',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'geofence_alerts',
                        'latitude',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'geofence_alerts',
                        'distance_meters',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'geofence_alerts',
                        'staff_userId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'geofence_alerts',
                        'restaurantId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'attendance_events',
                        'comment',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'attendance_events',
                        'out_of_geofence',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'attendance_events',
                        'distance_meters',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'attendance_events',
                        'longitude',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'attendance_events',
                        'latitude',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'attendance_events',
                        'event_time',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'attendance_events',
                        'event_type',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'attendance_events',
                        'work_shiftId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'attendance_events',
                        'staff_userId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'attendance_events',
                        'restaurantId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'work_shifts',
                        'shift_notes',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'work_shifts',
                        'shift_status',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'work_shifts',
                        'shift_role',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'work_shifts',
                        'shift_end',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'work_shifts',
                        'shift_start',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'work_shifts',
                        'staff_userId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'work_shifts',
                        'work_scheduleId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'work_schedules',
                        'notes',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'work_schedules',
                        'status',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'work_schedules',
                        'period_end',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'work_schedules',
                        'period_start',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'work_schedules',
                        'title',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'work_schedules',
                        'created_by_userId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'work_schedules',
                        'restaurantId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'restaurant_tables',
                        'is_available',
                        { transaction }
                    );
                
            
                
            
                
                    await queryInterface.removeColumn(
                        'restaurant_tables',
                        'qr_payload',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'restaurant_tables',
                        'seat_count',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'restaurant_tables',
                        'table_label',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'restaurant_tables',
                        'restaurantId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'restaurants',
                        'is_active',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'restaurants',
                        'geofence_radius_meters',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'restaurants',
                        'longitude',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'restaurants',
                        'latitude',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'restaurants',
                        'closing_time',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'restaurants',
                        'opening_time',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'restaurants',
                        'table_count',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'restaurants',
                        'staff_count_planned',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'restaurants',
                        'contact_phone',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'restaurants',
                        'address',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'restaurants',
                        'name',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'account_approvals',
                        'review_comment',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'account_approvals',
                        'reviewed_at',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'account_approvals',
                        'requested_at',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'account_approvals',
                        'status',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'account_approvals',
                        'reviewed_by_userId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'account_approvals',
                        'requested_by_userId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'account_approvals',
                        'candidate_userId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'permissions',
                        'name',
                        { transaction }
                    );
                
            
                
            
                
                    await queryInterface.removeColumn(
                        'roles',
                        'role_customization',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'roles',
                        'name',
                        { transaction }
                    );
                
            
                
            
                
                    await queryInterface.removeColumn(
                        'users',
                        'app_roleId',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'users',
                        'provider',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'users',
                        'passwordResetTokenExpiresAt',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'users',
                        'passwordResetToken',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'users',
                        'emailVerificationTokenExpiresAt',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'users',
                        'emailVerificationToken',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'users',
                        'emailVerified',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'users',
                        'password',
                        { transaction }
                    );
                
            
                
            
                
                    await queryInterface.removeColumn(
                        'users',
                        'disabled',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'users',
                        'email',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'users',
                        'phoneNumber',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'users',
                        'lastName',
                        { transaction }
                    );
                
            
                
                    await queryInterface.removeColumn(
                        'users',
                        'firstName',
                        { transaction }
                    );
                
            
                
                    await queryInterface.dropTable('audit_logs', { transaction });
                
            
                
                    await queryInterface.dropTable('invoices', { transaction });
                
            
                
                    await queryInterface.dropTable('stock_movements', { transaction });
                
            
                
                    await queryInterface.dropTable('stock_items', { transaction });
                
            
                
                    await queryInterface.dropTable('stock_locations', { transaction });
                
            
                
                    await queryInterface.dropTable('notification_events', { transaction });
                
            
                
                    await queryInterface.dropTable('customer_reviews', { transaction });
                
            
                
                    await queryInterface.dropTable('loyalty_transactions', { transaction });
                
            
                
                    await queryInterface.dropTable('loyalty_rules', { transaction });
                
            
                
                    await queryInterface.dropTable('loyalty_accounts', { transaction });
                
            
                
                    await queryInterface.dropTable('payments', { transaction });
                
            
                
                    await queryInterface.dropTable('reservations', { transaction });
                
            
                
                    await queryInterface.dropTable('order_items', { transaction });
                
            
                
                    await queryInterface.dropTable('orders', { transaction });
                
            
                
                    await queryInterface.dropTable('menu_items', { transaction });
                
            
                
                    await queryInterface.dropTable('menu_categories', { transaction });
                
            
                
                    await queryInterface.dropTable('geofence_alerts', { transaction });
                
            
                
                    await queryInterface.dropTable('attendance_events', { transaction });
                
            
                
                    await queryInterface.dropTable('work_shifts', { transaction });
                
            
                
                    await queryInterface.dropTable('work_schedules', { transaction });
                
            
                
                    await queryInterface.dropTable('restaurant_tables', { transaction });
                
            
                
                    await queryInterface.dropTable('restaurants', { transaction });
                
            
                
                    await queryInterface.dropTable('account_approvals', { transaction });
                
            
                
                    await queryInterface.dropTable('permissions', { transaction });
                
            
                
                    await queryInterface.dropTable('roles', { transaction });
                
            
                
                    await queryInterface.dropTable('users', { transaction });
                
            
            await transaction.commit();
        } catch (err) {
            await transaction.rollback();
            throw err;
        }
    }
};
