Skip to content

Commit

Permalink
Updating table
Browse files Browse the repository at this point in the history
  • Loading branch information
kwonye committed Jul 29, 2018
1 parent a947664 commit 3834d18
Showing 1 changed file with 13 additions and 5 deletions.
Expand Up @@ -25,6 +25,8 @@ public static void createTables(SQLiteDatabase db) {
+ " genericon TEXT NOT NULL,"
+ " icon_url TEXT NOT NULL,"
+ " connect_url TEXT NOT NULL,"
+ " has_multiple_external_user_id_support INTEGER DEFAULT 0,"
+ " is_external_users_only INTEGER DEFAULT 0,"
+ " is_jetpack_supported INTEGER DEFAULT 0,"
+ " is_multi_user_id_supported INTEGER DEFAULT 0,"
+ " PRIMARY KEY (id))");
Expand Down Expand Up @@ -110,18 +112,22 @@ public static void setServiceList(final PublicizeServiceList serviceList) {
+ " genericon," // 4
+ " icon_url," // 5
+ " connect_url," // 6
+ " is_jetpack_supported," // 7
+ " is_multi_user_id_supported)" // 8
+ " VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8)");
+ " has_multiple_external_user_id_support," // 7
+ " is_external_users_only," // 8
+ " is_jetpack_supported," // 9
+ " is_multi_user_id_supported)" // 10
+ " VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10)");
for (PublicizeService service : serviceList) {
stmt.bindString(1, service.getId());
stmt.bindString(2, service.getLabel());
stmt.bindString(3, service.getDescription());
stmt.bindString(4, service.getGenericon());
stmt.bindString(5, service.getIconUrl());
stmt.bindString(6, service.getConnectUrl());
stmt.bindLong(7, SqlUtils.boolToSql(service.isJetpackSupported()));
stmt.bindLong(8, SqlUtils.boolToSql(service.isMultiExternalUserIdSupported()));
stmt.bindLong(7, SqlUtils.boolToSql(service.getHasMultipleExternalUserIdSupport()));
stmt.bindLong(8, SqlUtils.boolToSql(service.getIsExternalUsersOnly()));
stmt.bindLong(9, SqlUtils.boolToSql(service.isJetpackSupported()));
stmt.bindLong(10, SqlUtils.boolToSql(service.isMultiExternalUserIdSupported()));
stmt.executeInsert();
}

Expand All @@ -141,6 +147,8 @@ private static PublicizeService getServiceFromCursor(Cursor c) {
service.setGenericon(c.getString(c.getColumnIndex("genericon")));
service.setIconUrl(c.getString(c.getColumnIndex("icon_url")));
service.setConnectUrl(c.getString(c.getColumnIndex("connect_url")));
service.setHasMultipleExternalUserIdSupport(SqlUtils.sqlToBool(c.getColumnIndex("has_multiple_external_user_id_support")));
service.setHasMultipleExternalUserIdSupport(SqlUtils.sqlToBool(c.getColumnIndex("is_external_users_only")));
service.setIsJetpackSupported(SqlUtils.sqlToBool(c.getColumnIndex("is_jetpack_supported")));
service.setIsMultiExternalUserIdSupported(SqlUtils.sqlToBool(c.getColumnIndex("is_multi_user_id_supported")));

Expand Down

0 comments on commit 3834d18

Please sign in to comment.