Revert "add POSITION column to groups table, unused as yet"

This reverts commit 7be6a182f0.
This commit is contained in:
Eric House 2012-12-26 19:35:21 -08:00
parent 68026fef3e
commit 8bba5d6106

View file

@ -80,7 +80,6 @@ public class DBHelper extends SQLiteOpenHelper {
public static final String LASTPLAY_TIME = "LASTPLAY_TIME"; public static final String LASTPLAY_TIME = "LASTPLAY_TIME";
public static final String GROUPNAME = "GROUPNAME"; public static final String GROUPNAME = "GROUPNAME";
public static final String POSITION = "POSITION";
public static final String EXPANDED = "EXPANDED"; public static final String EXPANDED = "EXPANDED";
private Context m_context; private Context m_context;
@ -143,7 +142,6 @@ public class DBHelper extends SQLiteOpenHelper {
private static final String[] s_groupsSchema = { private static final String[] s_groupsSchema = {
GROUPNAME, "TEXT" GROUPNAME, "TEXT"
,POSITION, "INTEGER"
,EXPANDED, "INTEGER(1)" ,EXPANDED, "INTEGER(1)"
}; };
@ -202,7 +200,6 @@ public class DBHelper extends SQLiteOpenHelper {
createGroupsTable( db ); createGroupsTable( db );
case 15: case 15:
moveToCurGames( db ); moveToCurGames( db );
addGroupsColumn( db, POSITION );
// nothing yet // nothing yet
break; break;
default: 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; String colType = null;
for ( int ii = 0; ii < schema.length; ii += 2 ) { for ( int ii = 0; ii < s_summaryColsAndTypes.length; ii += 2 ) {
if ( schema[ii].equals( colName ) ) { if ( s_summaryColsAndTypes[ii].equals( colName ) ) {
result = schema[ii+1]; colType = s_summaryColsAndTypes[ii+1];
break; 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;", String cmd = String.format( "ALTER TABLE %s ADD COLUMN %s %s;",
TABLE_NAME_SUM, colName, colType ); TABLE_NAME_SUM, colName, colType );
db.execSQL( cmd ); 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 ) private void createTable( SQLiteDatabase db, String name, String[] data )
{ {
StringBuilder query = StringBuilder query =