diff --git a/app/src/androidMain/kotlin/db/Database.kt b/app/src/androidMain/kotlin/db/Database.kt index aa0368e8..b17c80a4 100644 --- a/app/src/androidMain/kotlin/db/Database.kt +++ b/app/src/androidMain/kotlin/db/Database.kt @@ -46,6 +46,8 @@ class Database(path: String) { execSQL(ConfQueries.CREATE_TABLE) execSQL("PRAGMA user_version=1") } + + execSQL(ElementCommentQueries.CREATE_INDICES) } } diff --git a/app/src/androidMain/kotlin/element_comment/ElementCommentQueries.kt b/app/src/androidMain/kotlin/element_comment/ElementCommentQueries.kt index 4aba2930..f5201a25 100644 --- a/app/src/androidMain/kotlin/element_comment/ElementCommentQueries.kt +++ b/app/src/androidMain/kotlin/element_comment/ElementCommentQueries.kt @@ -18,6 +18,9 @@ class ElementCommentQueries(private val conn: SQLiteConnection) { updated_at TEXT NOT NULL ); """ + const val CREATE_INDICES = """ + CREATE INDEX IF NOT EXISTS element_comment_element_id ON element_comment(element_id); + """ } fun insertOrReplace(comments: List) {