From 5a9187741ea9b419111a2a00e5832f98b32fcb5b Mon Sep 17 00:00:00 2001 From: yuweiguocn Date: Tue, 21 Nov 2017 10:41:49 +0800 Subject: [PATCH] version 2.0.1,fix issue #29 --- README.md | 2 +- README_CH.md | 2 +- library/build.gradle | 6 +++--- .../github/yuweiguocn/library/greendao/MigrationHelper.java | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 9f6ace3..a08eee0 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ The original code is from [stackoverflow](http://stackoverflow.com/a/30334668/71 ``` dependencies { compile 'org.greenrobot:greendao:3.2.0' - compile 'com.github.yuweiguocn:GreenDaoUpgradeHelper:v2.0.0' + compile 'com.github.yuweiguocn:GreenDaoUpgradeHelper:v2.0.1' } ``` or (greendao 3.0 below) diff --git a/README_CH.md b/README_CH.md index a202d18..7d1b361 100644 --- a/README_CH.md +++ b/README_CH.md @@ -24,7 +24,7 @@ GreenDaoUpgradeHelper是一个greenDao的数据库升级帮助类。使用它可 ``` dependencies { compile 'org.greenrobot:greendao:3.2.0' - compile 'com.github.yuweiguocn:GreenDaoUpgradeHelper:v2.0.0' + compile 'com.github.yuweiguocn:GreenDaoUpgradeHelper:v2.0.1' } ``` 如果你使用的greendao是3.0以前的版本,请使用下面的依赖: diff --git a/library/build.gradle b/library/build.gradle index a5368f2..3497ac2 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -7,8 +7,8 @@ android { defaultConfig { minSdkVersion 9 targetSdkVersion 23 - versionCode 200 - versionName "2.0" + versionCode 201 + versionName "2.0.1" } buildTypes { release { @@ -32,7 +32,7 @@ publish { userOrg = 'yuweiguocn'//用户名 groupId = 'io.github.yuweiguocn'//包名 artifactId = 'GreenDaoUpgradeHelper'//类库名 - publishVersion = '2.0.0'//版本号 + publishVersion = '2.0.1'//版本号 desc = 'To solve database upgrade of greenDao and just need one line code.'//描述 website = 'https://github.com/yuweiguocn/GreenDaoUpgradeHelper'//对应的github网址 } \ No newline at end of file diff --git a/library/src/main/java/com/github/yuweiguocn/library/greendao/MigrationHelper.java b/library/src/main/java/com/github/yuweiguocn/library/greendao/MigrationHelper.java index 781e2f7..4cb310f 100644 --- a/library/src/main/java/com/github/yuweiguocn/library/greendao/MigrationHelper.java +++ b/library/src/main/java/com/github/yuweiguocn/library/greendao/MigrationHelper.java @@ -197,7 +197,7 @@ private static void restoreData(Database db, Class>. final String columnSQL = TextUtils.join(",", properties); StringBuilder insertTableStringBuilder = new StringBuilder(); - insertTableStringBuilder.append("INSERT INTO ").append(tableName).append(" ("); + insertTableStringBuilder.append("REPLACE INTO ").append(tableName).append(" ("); insertTableStringBuilder.append(columnSQL); insertTableStringBuilder.append(") SELECT "); insertTableStringBuilder.append(columnSQL);