def _add_api_keys_to_users_table(table: Model, _column: Field) -> None: log.info('Adding API Keys for all users, might take some extra time...') with db_config.database.transaction(): for user in table: user.api_key = table.random_password(stronger=True) user.save()