SongSortColumns.ID + " INTEGER PRIMARY KEY," +
SongSortColumns.ARTIST_ID + " INTEGER NOT NULL," +
SongSortColumns.ALBUM_ID + " INTEGER NOT NULL," +
- SongSortColumns.NAME + " TEXT," +
+ SongSortColumns.NAME + " TEXT COLLATE LOCALIZED," +
SongSortColumns.NAME_LABEL + " TEXT," +
SongSortColumns.NAME_BUCKET + " INTEGER);",
}
public void onUpgrade(final SQLiteDatabase db, final int oldVersion, final int newVersion) {
- // this table was created in version 3 so call the onCreate method if we hit that scenario
- if (oldVersion < 3 && newVersion >= 3) {
+ // this table was created in version 3 so call the onCreate method if oldVersion <= 2
+ // in version 4 we need to recreate the SongSortcolumns table so drop the table and call
+ // onCreate if oldVersion <= 3
+ if (oldVersion <= 3) {
+ db.execSQL("DROP TABLE IF EXISTS " + SongSortColumns.TABLE_NAME);
onCreate(db);
}
}
* maintain data
* v3 Dec 4 2014 Add Sorting tables similar to Contacts to enable other languages like
* Chinese to properly sort as they would expect
+ * v4 Jan 6 2015 Missed Collate keyword on the LocalizedSongSortTable
*/
/* Version constant to increment when the database should be rebuilt */
- private static final int VERSION = 3;
+ private static final int VERSION = 4;
/* Name of database file */
public static final String DATABASENAME = "musicdb.db";