mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-27 06:29:54 +00:00
Fix bug where username may be put in e164 column.
This commit is contained in:
committed by
Cody Henthorne
parent
97c34b889a
commit
1355a4a28d
@@ -51,6 +51,12 @@ fun SupportSQLiteDatabase.getForeignKeys(): List<ForeignKeyConstraint> {
|
||||
.flatten()
|
||||
}
|
||||
|
||||
fun SupportSQLiteDatabase.areForeignKeyConstraintsEnabled(): Boolean {
|
||||
return this.query("PRAGMA foreign_keys", null).use { cursor ->
|
||||
cursor.moveToFirst() && cursor.getInt(0) != 0
|
||||
}
|
||||
}
|
||||
|
||||
fun SupportSQLiteDatabase.getIndexes(): List<Index> {
|
||||
return this.query("SELECT name, tbl_name FROM sqlite_master WHERE type='index' ORDER BY name ASC").readToList { cursor ->
|
||||
val indexName = cursor.requireNonNullString("name")
|
||||
|
||||
Reference in New Issue
Block a user