修复数据库升级的字段问题

This commit is contained in:
chenjuntao
2018-10-26 10:52:34 +08:00
parent b02ded094f
commit 1ffb36e1a3

View File

@ -8,10 +8,10 @@ import android.arch.persistence.room.migration.Migration;
import android.content.Context;
import android.support.annotation.NonNull;
import com.gh.gamecenter.qa.entity.AnswerEntity;
import com.gh.gamecenter.entity.LoginTokenEntity;
import com.gh.gamecenter.entity.SignEntity;
import com.gh.gamecenter.entity.UserInfoEntity;
import com.gh.gamecenter.qa.entity.AnswerEntity;
import com.gh.gamecenter.room.dao.AnswerDao;
import com.gh.gamecenter.room.dao.SignDao;
import com.gh.gamecenter.user.LoginTokenDao;
@ -77,7 +77,7 @@ public abstract class AppDatabase extends RoomDatabase {
@Override
public void migrate(@NonNull SupportSQLiteDatabase database) {
database.execSQL("Alter TABLE AnswerEntity add articleTitle TEXT");
database.execSQL("Alter TABLE AnswerEntity add type TEXT NOT NULL");
database.execSQL("Alter TABLE AnswerEntity add type TEXT NOT NULL DEFAULT ''");
}
};