Migrate SMS messages into the MMS table.

This commit is contained in:
Greyson Parrelli
2022-12-14 14:52:54 -05:00
parent cb0e7ade14
commit e9d98b7d39
59 changed files with 4399 additions and 6146 deletions

View File

@@ -44,6 +44,17 @@ object SqlUtil {
return tables
}
fun getNextAutoIncrementId(db: SupportSQLiteDatabase, table: String): Long {
db.query("SELECT * FROM sqlite_sequence WHERE name = ?", arrayOf(table)).use { cursor ->
if (cursor.moveToFirst()) {
val current = cursor.requireLong("seq")
return current + 1
} else {
throw IllegalArgumentException("Table must have an auto-incrementing primary key!")
}
}
}
/**
* Given a table, this will return a set of tables that it has a foreign key dependency on.
*/