According to this stack overflow greenDao Schema Upgrade
The guy "DiscDev" answer his own question but I got a question,on the onUpgrade method of these following code :
if(oldVersion == 3 && newVersion == 4){
boolean ifNotExists = false;
//Leave old tables alone and only create ones that didn't exist
//in the previous schema
NewTable1Dao.createTable(db, ifNotExists);
NewTable2Dao.createTable(db, ifNotExists);
NewTable3Dao.createTable(db, ifNotExists);
NewTable4Dao.createTable(db, ifNotExists);
} else {
dropAllTables(db, true);
onCreate(db);
}
the number of old version and new version how did he know the old version is 3 and new version is 4? And also why it needs to be hard code instead of declaration of constant number?