Delete column article id

This commit is contained in:
Victor Shcherb 2018-05-16 19:18:17 +02:00
parent 18a8449fd8
commit ed1a0f7d8d
2 changed files with 12 additions and 19 deletions

View file

@ -19,7 +19,6 @@ public class TravelArticle {
private static final String THUMB_PREFIX = "320px-";
private static final String REGULAR_PREFIX = "1280px-";//1280, 1024, 800
String id;
String title;
String content;
String isPartOf;
@ -33,9 +32,6 @@ public class TravelArticle {
String contentsJson;
String aggregatedPartOf;
public String getId() {
return id;
}
public String getTitle() {
return title;

View file

@ -48,7 +48,6 @@ public class TravelDbHelper {
private static final String ARTICLES_TABLE_NAME = "travel_articles";
private static final String POPULAR_TABLE_NAME = "popular_articles";
private static final String ARTICLES_COL_ID = "article_id";
private static final String ARTICLES_POP_INDEX = "popularity_index";
private static final String ARTICLES_POP_ORDER = "order_index";
private static final String ARTICLES_COL_TITLE = "title";
@ -65,7 +64,6 @@ public class TravelDbHelper {
private static final String ARTICLES_COL_AGGREGATED_PART_OF = "aggregated_part_of";
private static final String ARTICLES_TABLE_SELECT = "SELECT " +
ARTICLES_COL_ID + ", " +
ARTICLES_COL_TITLE + ", " +
ARTICLES_COL_CONTENT + ", " +
ARTICLES_COL_IS_PART_OF + ", " +
@ -568,24 +566,23 @@ public class TravelDbHelper {
private TravelArticle readArticle(SQLiteCursor cursor) {
TravelArticle res = new TravelArticle();
res.id = cursor.getString(0);
res.title = cursor.getString(1);
res.title = cursor.getString(0);
try {
res.content = Algorithms.gzipToString(cursor.getBlob(2));
res.content = Algorithms.gzipToString(cursor.getBlob(1));
} catch (IOException e) {
LOG.error(e.getMessage(), e);
}
res.isPartOf = cursor.getString(3);
res.lat = cursor.isNull(4) ? Double.NaN : cursor.getDouble(4);
res.lon = cursor.isNull(5) ? Double.NaN : cursor.getDouble(5);
res.imageTitle = cursor.getString(6);
res.tripId = cursor.getLong(8);
res.originalId = cursor.isNull(9) ? 0 : cursor.getLong(9);
res.lang = cursor.getString(10);
res.contentsJson = cursor.getString(11);
res.aggregatedPartOf = cursor.getString(12);
res.isPartOf = cursor.getString(2);
res.lat = cursor.isNull(3) ? Double.NaN : cursor.getDouble(3);
res.lon = cursor.isNull(4) ? Double.NaN : cursor.getDouble(4);
res.imageTitle = cursor.getString(5);
res.tripId = cursor.getLong(7);
res.originalId = cursor.isNull(8) ? 0 : cursor.getLong(8);
res.lang = cursor.getString(9);
res.contentsJson = cursor.getString(10);
res.aggregatedPartOf = cursor.getString(11);
try {
String gpxContent = Algorithms.gzipToString(cursor.getBlob(7));
String gpxContent = Algorithms.gzipToString(cursor.getBlob(6));
res.gpxFile = GPXUtilities.loadGPXFile(application, new ByteArrayInputStream(gpxContent.getBytes("UTF-8")));
} catch (IOException e) {
LOG.error(e.getMessage(), e);