mirror of
https://github.com/nextcloud/notes-android.git
synced 2024-11-27 09:46:50 +03:00
Fix #696 Database upgrade
This commit is contained in:
parent
37c41bf67a
commit
a4f798164e
1 changed files with 1 additions and 2 deletions
|
@ -174,7 +174,6 @@ public class NoteSQLiteOpenHelper extends SQLiteOpenHelper {
|
|||
db.execSQL("CREATE TABLE " + table_temp + " ( " +
|
||||
key_id + " INTEGER PRIMARY KEY AUTOINCREMENT, " +
|
||||
key_remote_id + " INTEGER, " +
|
||||
key_account_id + " INTEGER, " +
|
||||
key_status + " VARCHAR(50), " +
|
||||
key_title + " TEXT, " +
|
||||
key_modified + " INTEGER DEFAULT 0, " +
|
||||
|
@ -182,7 +181,7 @@ public class NoteSQLiteOpenHelper extends SQLiteOpenHelper {
|
|||
key_favorite + " INTEGER DEFAULT 0, " +
|
||||
key_category + " TEXT NOT NULL DEFAULT '', " +
|
||||
key_etag + " TEXT)");
|
||||
createNotesIndexes(db);
|
||||
DatabaseIndexUtil.createIndex(db, table_temp, key_remote_id, key_status, key_favorite, key_category, key_modified);
|
||||
db.execSQL(String.format("INSERT INTO %s(%s,%s,%s,%s,%s,%s,%s,%s,%s) ", table_temp, key_id, key_remote_id, key_status, key_title, key_modified, key_content, key_favorite, key_category, key_etag)
|
||||
+ String.format("SELECT %s,%s,%s,%s,strftime('%%s',%s),%s,%s,%s,%s FROM %s", key_id, key_remote_id, key_status, key_title, key_modified, key_content, key_favorite, key_category, key_etag, table_notes));
|
||||
db.execSQL(String.format("DROP TABLE %s", table_notes));
|
||||
|
|
Loading…
Reference in a new issue