public void createColumnIfNotExists(final SQLiteDatabase db, final String table, final String columnDefinition) {
            try {
                db.execSQL("ALTER TABLE " + table + " ADD COLUMN " + columnDefinition);
                Log.i("[DB] Column '" + table + "'.'" + columnDefinition + "' created");
            } catch (SQLiteException sle) {
                if (!sle.getMessage().contains("duplicate column name")) {
                    throw sle;
                }
                Log.iForce("[DB] Column '" + table + "'.'" + columnDefinition + "' was not created because it already exists. " +
                        "It is expected that this can happen and not an error.");
            }
        }
Helper for columns creation. This method ignores duplicate column errors
and is useful for migration situations
main/src/main/java/cgeo/geocaching/storage/DataStore.java