diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/DBHelper.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/DBHelper.java index 3a6fd4f2f..d25ce2c14 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/DBHelper.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/DBHelper.java @@ -37,8 +37,9 @@ public class DBHelper extends SQLiteOpenHelper { public static final String TABLE_NAME_DICTINFO = "dictinfo"; public static final String TABLE_NAME_GROUPS = "groups"; public static final String TABLE_NAME_STUDYLIST = "study"; + public static final String TABLE_NAME_LOC = "loc"; private static final String DB_NAME = "xwdb"; - private static final int DB_VERSION = 20; + private static final int DB_VERSION = 21; public static final String GAME_NAME = "GAME_NAME"; public static final String VISID = "VISID"; @@ -92,6 +93,11 @@ public class DBHelper extends SQLiteOpenHelper { public static final String WORD = "WORD"; public static final String LANGUAGE = "LANGUAGE"; + public static final String KEY = "KEY"; + public static final String LOCALE = "LOCALE"; + public static final String XLATION = "XLATION"; + + private Context m_context; private static final String[][] s_summaryColsAndTypes = { @@ -165,6 +171,12 @@ public class DBHelper extends SQLiteOpenHelper { ,{ "UNIQUE", "(" + WORD + ", " + LANGUAGE + ")" } }; + private static final String[][] s_locSchema = { + { KEY, "TEXT" } + ,{ LOCALE, "TEXT(5)" } + ,{ XLATION, "TEXT" } + }; + public DBHelper( Context context ) { super( context, DB_NAME, null, DB_VERSION ); @@ -240,6 +252,8 @@ public class DBHelper extends SQLiteOpenHelper { // NPACKETSPENDING also added by makeAutoincrement above addSumColumn( db, NPACKETSPENDING ); } + case 20: + createLocTable( db ); break; default: db.execSQL( "DROP TABLE " + TABLE_NAME_SUM + ";" ); @@ -314,6 +328,11 @@ public class DBHelper extends SQLiteOpenHelper { createTable( db, TABLE_NAME_STUDYLIST, s_studySchema ); } + private void createLocTable( SQLiteDatabase db ) + { + createTable( db, TABLE_NAME_LOC, s_locSchema ); + } + // Move all existing games to the row previously named "cur games' private void moveToCurGames( SQLiteDatabase db ) {