mirror of
https://github.com/leanote/leanote-android.git
synced 2025-10-17 07:54:24 +00:00
fix migration bug
This commit is contained in:
@@ -51,10 +51,10 @@ public class AppDataBase {
|
|||||||
int tagIndex = cursor.getColumnIndex("tags");
|
int tagIndex = cursor.getColumnIndex("tags");
|
||||||
int uidIndex = cursor.getColumnIndex("userId");
|
int uidIndex = cursor.getColumnIndex("userId");
|
||||||
while (cursor.moveToNext()) {
|
while (cursor.moveToNext()) {
|
||||||
String tag = cursor.getString(tagIndex);
|
String originalTagText = cursor.getString(tagIndex);
|
||||||
String uid = cursor.getString(uidIndex);
|
String uid = cursor.getString(uidIndex);
|
||||||
long noteLocalId = cursor.getLong(idIndex);
|
long noteLocalId = cursor.getLong(idIndex);
|
||||||
String[] tagTexts = tag.split(",");
|
String[] tagTexts = originalTagText.split(",");
|
||||||
for (String tagText : tagTexts) {
|
for (String tagText : tagTexts) {
|
||||||
tagText = tagText.trim();
|
tagText = tagText.trim();
|
||||||
if (TextUtils.isEmpty(tagText)) {
|
if (TextUtils.isEmpty(tagText)) {
|
||||||
@@ -63,7 +63,7 @@ public class AppDataBase {
|
|||||||
Tag tagModel = SQLite.select()
|
Tag tagModel = SQLite.select()
|
||||||
.from(Tag.class)
|
.from(Tag.class)
|
||||||
.where(Tag_Table.userId.eq(uid))
|
.where(Tag_Table.userId.eq(uid))
|
||||||
.and(Tag_Table.text.eq(tag))
|
.and(Tag_Table.text.eq(tagText))
|
||||||
.querySingle(database);
|
.querySingle(database);
|
||||||
long tagId;
|
long tagId;
|
||||||
if (tagModel == null) {
|
if (tagModel == null) {
|
||||||
|
Reference in New Issue
Block a user