public static String createTableDefinition(TableInfo tableInfo) {
    final ArrayList<String> definitions = new ArrayList<String>();

    for (Field field : tableInfo.getFields()) {
      String definition = createColumnDefinition(tableInfo, field);
      if (!TextUtils.isEmpty(definition)) {
        definitions.add(definition);
      }
    }

    return String.format(
        "CREATE TABLE IF NOT EXISTS %s (%s);",
        tableInfo.getTableName(), TextUtils.join(", ", definitions));
  }
  public static String createIndexDefinition(TableInfo tableInfo) {
    final ArrayList<String> definitions = new ArrayList<String>();

    for (Field field : tableInfo.getFields()) {
      String definition = createIndexColumnDefinition(tableInfo, field);
      if (!TextUtils.isEmpty(definition)) {
        definitions.add(definition);
      }
    }
    if (definitions.isEmpty()) return null;

    return String.format(
        "CREATE INDEX IF NOT EXISTS %s on %s(%s);",
        "index_" + tableInfo.getTableName(),
        tableInfo.getTableName(),
        TextUtils.join(",", definitions));
  }