Make Sms/MmsDatabase ID's autoincrement.

This commit is contained in:
Greyson Parrelli
2021-07-15 13:17:53 -04:00
parent 51a521594f
commit 83086a5a2b
4 changed files with 221 additions and 27 deletions

View File

@@ -40,8 +40,6 @@ public class ApplicationMigrations {
private static final int LEGACY_CANONICAL_VERSION = 455;
public static final int CURRENT_VERSION = 36;
private static final class Version {
static final int LEGACY = 1;
static final int RECIPIENT_ID = 2;
@@ -78,8 +76,11 @@ public class ApplicationMigrations {
static final int APPLY_UNIVERSAL_EXPIRE = 34;
static final int SENDER_KEY = 35;
static final int SENDER_KEY_2 = 36;
static final int DB_AUTOINCREMENT = 37;
}
public static final int CURRENT_VERSION = 37;
/**
* This *must* be called after the {@link JobManager} has been instantiated, but *before* the call
* to {@link JobManager#beginJobLoop()}. Otherwise, other non-migration jobs may have started
@@ -332,6 +333,10 @@ public class ApplicationMigrations {
jobs.put(Version.SENDER_KEY_2, new AttributesMigrationJob());
}
if (lastSeenVersion < Version.DB_AUTOINCREMENT) {
jobs.put(Version.DB_AUTOINCREMENT, new DatabaseMigrationJob());
}
return jobs;
}