As I am working on a project that involves multiple developers, and we are using DVCS, each developer will be working on a feature branch assigned to them. That being said, the feature branches are branched out from the latest develop branch. In the develop branch, the db version in the DatabaseHandler is
private static final int DATABASE_VERSION = 2;
In my feature branch, I am required to make a new table. So I have to increase the version to 3, so I can include the following in onUpgrade to execute the CREATE_APPLIANCE_TABLE statement.
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
Log.d("Database onUpgrade", "Old is: " + oldVersion + ". New is: " + newVersion);
switch(oldVersion) {
case 1:
db.execSQL(CREATE_USER);
case 2:
db.execSQL(CREATE_APPLIANCE_ACTIVITY); // for version 3
}
}
My concern is, what if another developer needs to make a new table too, and he carries out the same process as me. Do he increase the version in his feature branch to 3? And if so, what should be our next step when either or both of us close our feature branch and merged it into develop? Since we both edited the same file, there may be chance of conflict. So in the develop branch, do the version stay at 3, or?
Thanks in advance. :)