mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-07 01:28:52 -06:00
Add more constraints on table Repetitions
This commit is contained in:
@@ -45,15 +45,16 @@ public class HabitsDatabaseOpener extends SQLiteOpenHelper
|
||||
@Override
|
||||
public void onCreate(SQLiteDatabase db)
|
||||
{
|
||||
onUpgrade(db, 8, version);
|
||||
db.setVersion(8);
|
||||
onUpgrade(db, -1, version);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion)
|
||||
{
|
||||
if(oldVersion < 8) throw new UnsupportedDatabaseVersionException();
|
||||
if(db.getVersion() < 8) throw new UnsupportedDatabaseVersionException();
|
||||
helper = new MigrationHelper(new AndroidDatabase(db));
|
||||
helper.executeMigrations(oldVersion, newVersion);
|
||||
helper.migrateTo(newVersion);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -38,7 +38,7 @@ public class AndroidDatabase implements Database
|
||||
}
|
||||
|
||||
@Override
|
||||
public Cursor select(String query, String... params)
|
||||
public Cursor query(String query, String... params)
|
||||
{
|
||||
return new AndroidCursor(db.rawQuery(query, params));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user