kopia lustrzana https://github.com/ryukoposting/Signal-Android
Cherry pick mentions badge database migration.
rodzic
f0e94ebbad
commit
0d715d2c18
|
@ -13,13 +13,14 @@ import org.thoughtcrime.securesms.database.helpers.migration.V155_SmsExporterMig
|
||||||
import org.thoughtcrime.securesms.database.helpers.migration.V156_RecipientUnregisteredTimestampMigration
|
import org.thoughtcrime.securesms.database.helpers.migration.V156_RecipientUnregisteredTimestampMigration
|
||||||
import org.thoughtcrime.securesms.database.helpers.migration.V157_RecipeintHiddenMigration
|
import org.thoughtcrime.securesms.database.helpers.migration.V157_RecipeintHiddenMigration
|
||||||
import org.thoughtcrime.securesms.database.helpers.migration.V158_GroupsLastForceUpdateTimestampMigration
|
import org.thoughtcrime.securesms.database.helpers.migration.V158_GroupsLastForceUpdateTimestampMigration
|
||||||
|
import org.thoughtcrime.securesms.database.helpers.migration.V159_ThreadUnreadSelfMentionCount
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Contains all of the database migrations for [SignalDatabase]. Broken into a separate file for cleanliness.
|
* Contains all of the database migrations for [SignalDatabase]. Broken into a separate file for cleanliness.
|
||||||
*/
|
*/
|
||||||
object SignalDatabaseMigrations {
|
object SignalDatabaseMigrations {
|
||||||
|
|
||||||
const val DATABASE_VERSION = 158
|
const val DATABASE_VERSION = 159
|
||||||
|
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun migrate(context: Application, db: SQLiteDatabase, oldVersion: Int, newVersion: Int) {
|
fun migrate(context: Application, db: SQLiteDatabase, oldVersion: Int, newVersion: Int) {
|
||||||
|
@ -62,6 +63,10 @@ object SignalDatabaseMigrations {
|
||||||
if (oldVersion < 158) {
|
if (oldVersion < 158) {
|
||||||
V158_GroupsLastForceUpdateTimestampMigration.migrate(context, db, oldVersion, newVersion)
|
V158_GroupsLastForceUpdateTimestampMigration.migrate(context, db, oldVersion, newVersion)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (oldVersion < 159) {
|
||||||
|
V159_ThreadUnreadSelfMentionCount.migrate(context, db, oldVersion, newVersion)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
package org.thoughtcrime.securesms.database.helpers.migration
|
||||||
|
|
||||||
|
import android.app.Application
|
||||||
|
import net.zetetic.database.sqlcipher.SQLiteDatabase
|
||||||
|
|
||||||
|
object V159_ThreadUnreadSelfMentionCount : SignalDatabaseMigration {
|
||||||
|
override fun migrate(context: Application, db: SQLiteDatabase, oldVersion: Int, newVersion: Int) {
|
||||||
|
db.execSQL("ALTER TABLE thread ADD COLUMN unread_self_mention_count INTEGER DEFAULT 0")
|
||||||
|
}
|
||||||
|
}
|
Ładowanie…
Reference in New Issue