fix the version conflict bug in AbstractNotesDatabase.java

This commit is contained in:
Peter S 2020-05-29 15:05:34 +08:00
parent 592e45ce71
commit 41e393c117

View file

@ -32,7 +32,7 @@ import it.niedermann.owncloud.notes.util.NoteUtil;
abstract class AbstractNotesDatabase extends SQLiteOpenHelper { abstract class AbstractNotesDatabase extends SQLiteOpenHelper {
private static final String TAG = AbstractNotesDatabase.class.getSimpleName(); private static final String TAG = AbstractNotesDatabase.class.getSimpleName();
private static final int database_version = 15; private static final int database_version = 16;
@NonNull @NonNull
private final Context context; private final Context context;
@ -439,7 +439,7 @@ abstract class AbstractNotesDatabase extends SQLiteOpenHelper {
tmpNotesCursor.close(); tmpNotesCursor.close();
db.execSQL("DROP TABLE IF EXISTS " + tmpTableNotes); db.execSQL("DROP TABLE IF EXISTS " + tmpTableNotes);
} }
if (oldVersion < 15) { if (oldVersion < 16) {
// add a new column to store the sorting method for a category note list // add a new column to store the sorting method for a category note list
db.execSQL("ALTER TABLE " + table_category + " ADD COLUMN " + key_category_sorting_method + " INTEGER DEFAULT 0"); db.execSQL("ALTER TABLE " + table_category + " ADD COLUMN " + key_category_sorting_method + " INTEGER DEFAULT 0");
} }