Fix table drop order during backup import.

Fixes #12671
This commit is contained in:
Greyson Parrelli
2022-12-12 11:54:05 -05:00
committed by GitHub
parent a6a185004d
commit bd11ed9f17
3 changed files with 239 additions and 23 deletions

View File

@@ -33,6 +33,17 @@ object SqlUtil {
return tables
}
@JvmStatic
fun getAllTriggers(db: SupportSQLiteDatabase): List<String> {
val tables: MutableList<String> = LinkedList()
db.query("SELECT name FROM sqlite_master WHERE type=?", arrayOf("trigger")).use { cursor ->
while (cursor.moveToNext()) {
tables.add(cursor.getString(0))
}
}
return tables
}
/**
* Given a table, this will return a set of tables that it has a foreign key dependency on.
*/