private static void migrateKeyIndexes6_7(@NonNull final SupportSQLiteDatabase database) {
        final Cursor cursor = database.query("SELECT uuid, netKeys, appKeys FROM nodes");
        if (cursor != null && cursor.moveToFirst()) {
            do {
                try {
                    final ContentValues values = new ContentValues();
                    final String uuid = cursor.getString(cursor.getColumnIndex("uuid"));
                    final String netKeysJson = cursor.getString(cursor.getColumnIndex("netKeys"));
                    final List<Integer> netKeys = MeshTypeConverters.fromJsonToIntegerList(netKeysJson);
                    final List<NodeKey> netKeyIndexes = new ArrayList<>();
                    for (Integer keyIndex : netKeys) {
                        if (keyIndex != null) {
                            netKeyIndexes.add(new NodeKey(keyIndex, false));
                        }
                    }
                    values.put("netKeys", MeshTypeConverters.nodeKeysToJson(netKeyIndexes));

                    final List<NodeKey> appKeyIndexes = new ArrayList<>();
                    final String appKeysJson = cursor.getString(cursor.getColumnIndex("appKeys"));
                    final List<Integer> appKeys = MeshTypeConverters.fromJsonToIntegerList(appKeysJson);
                    for (Integer keyIndex : appKeys) {
                        appKeyIndexes.add(new NodeKey(keyIndex, false));
                    }
                    values.put("appKeys", MeshTypeConverters.nodeKeysToJson(appKeyIndexes));
                    database.update("nodes", SQLiteDatabase.CONFLICT_REPLACE, values, "uuid = ?", new String[]{uuid});
                } catch (Exception ex) {
                    MeshLogger.verbose(TAG, "Something went wrong while migrating data");
                }
            } while (cursor.moveToNext());
            cursor.close();
        }
    }
Override the onOpen method to populate the database.
For this sample, we clear the database every time it is created or opened.
<p>
If you want to populate the database only when the database is created for the 1st time,
override RoomDatabase.Callback()#onCreate
mesh/src/main/java/no/nordicsemi/android/mesh/MeshNetworkDb.java