Can't downgrade database from version 2 to 1 even after fresh install and re-run

后端 未结 10 1167
离开以前
离开以前 2020-12-16 01:14

I\'m writing an android app using SQLite DB.

I had few experiments and changed the DB version from 1 to 2.

Then my DB schema became stable and because i didn

10条回答
  •  Happy的楠姐
    2020-12-16 01:47

    Had the same problem and I solved it like this.

    @Override
    public void onDowngrade(SQLiteDatabase db, int oldVersion, int newVersion) {
      db.setVersion(oldVersion);
    }
    

提交回复
热议问题