Q:

Android kotlin how to have switch conditions without break statement

I had switch in Java without break statement. when i converted to Kotlin. it has put When which i tested and executed only the condition i pass to that function
here is the code of JAVA
 switch (version) {
            case 1:
                onCreate(db);

            case 2:
                db.execSQL("CREATE TABLE IF NOT EXISTS ");
                db.execSQL("CREATE TABLE IF NOT EXISTS ");
        }

KOTLIN:
 when (version) {
                1 -> {
                    onCreate(db)
                }

                2 -> {
                    db.execSQL("CREATE TABLE IF NOT EXISTS ")
                    db.execSQL("CREATE TABLE IF NOT EXISTS ")
                }
            }

A:

How about:
if (version <= 1) {
    onCreate(db)
}

if (version <= 2) {
    db.execSQL("CREATE TABLE IF NOT EXISTS ")
    db.execSQL("CREATE TABLE IF NOT EXISTS ")
}

