Fix bug where username may be put in e164 column.

This commit is contained in:
Greyson Parrelli
2023-11-30 09:32:04 -08:00
committed by Cody Henthorne
parent 97c34b889a
commit 1355a4a28d
6 changed files with 86 additions and 6 deletions

View File

@@ -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")