From 8bba5d610629e4b53188d0cdbeaf89ecc97aca87 Mon Sep 17 00:00:00 2001 From: Eric House Date: Wed, 26 Dec 2012 19:35:21 -0800 Subject: [PATCH] Revert "add POSITION column to groups table, unused as yet" This reverts commit 7be6a182f0074a2277f32b200157a60963c63147. --- .../src/org/eehouse/android/xw4/DBHelper.java | 26 ++++--------------- 1 file changed, 5 insertions(+), 21 deletions(-) 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 083ed7c4d..b13ded1e4 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/DBHelper.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/DBHelper.java @@ -80,7 +80,6 @@ public class DBHelper extends SQLiteOpenHelper { public static final String LASTPLAY_TIME = "LASTPLAY_TIME"; public static final String GROUPNAME = "GROUPNAME"; - public static final String POSITION = "POSITION"; public static final String EXPANDED = "EXPANDED"; private Context m_context; @@ -143,7 +142,6 @@ public class DBHelper extends SQLiteOpenHelper { private static final String[] s_groupsSchema = { GROUPNAME, "TEXT" - ,POSITION, "INTEGER" ,EXPANDED, "INTEGER(1)" }; @@ -202,7 +200,6 @@ public class DBHelper extends SQLiteOpenHelper { createGroupsTable( db ); case 15: moveToCurGames( db ); - addGroupsColumn( db, POSITION ); // nothing yet break; default: @@ -214,34 +211,21 @@ public class DBHelper extends SQLiteOpenHelper { } } - private String typeFor( String[] schema, String colName ) + private void addSumColumn( SQLiteDatabase db, String colName ) { - String result = null; - for ( int ii = 0; ii < schema.length; ii += 2 ) { - if ( schema[ii].equals( colName ) ) { - result = schema[ii+1]; + String colType = null; + for ( int ii = 0; ii < s_summaryColsAndTypes.length; ii += 2 ) { + if ( s_summaryColsAndTypes[ii].equals( colName ) ) { + colType = s_summaryColsAndTypes[ii+1]; break; } } - return result; - } - private void addSumColumn( SQLiteDatabase db, String colName ) - { - String colType = typeFor( s_summaryColsAndTypes, colName ); String cmd = String.format( "ALTER TABLE %s ADD COLUMN %s %s;", TABLE_NAME_SUM, colName, colType ); db.execSQL( cmd ); } - private void addGroupsColumn( SQLiteDatabase db, String colName ) - { - String colType = typeFor( s_groupsSchema, colName ); - String cmd = String.format( "ALTER TABLE %s ADD COLUMN %s %s;", - TABLE_NAME_GROUPS, colName, colType ); - db.execSQL( cmd ); - } - private void createTable( SQLiteDatabase db, String name, String[] data ) { StringBuilder query =