Skip to content

Commit

Permalink
Add migration for new issue
Browse files Browse the repository at this point in the history
  • Loading branch information
NoComment1105 committed Feb 26, 2024
1 parent e6861cf commit c1f1acb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import org.hyacinthbots.lilybot.database.migrations.config.configV5
import org.hyacinthbots.lilybot.database.migrations.config.configV6
import org.hyacinthbots.lilybot.database.migrations.config.configV7
import org.hyacinthbots.lilybot.database.migrations.main.mainV1
import org.hyacinthbots.lilybot.database.migrations.main.mainV10
import org.hyacinthbots.lilybot.database.migrations.main.mainV2
import org.hyacinthbots.lilybot.database.migrations.main.mainV3
import org.hyacinthbots.lilybot.database.migrations.main.mainV4
Expand Down Expand Up @@ -73,6 +74,7 @@ object Migrator : KordExKoinComponent {
7 -> ::mainV7
8 -> ::mainV8
9 -> ::mainV9
10 -> ::mainV10
else -> break
}(db.mainDatabase)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package org.hyacinthbots.lilybot.database.migrations.main

import org.hyacinthbots.lilybot.database.entities.AutoThreadingData
import org.litote.kmongo.coroutine.CoroutineDatabase
import org.litote.kmongo.exists
import org.litote.kmongo.setValue

suspend fun mainV10(db: CoroutineDatabase) {
with(db.getCollection<AutoThreadingData>()) {
updateMany(AutoThreadingData::extraRoleIds exists false, setValue(AutoThreadingData::extraRoleIds, emptyList()))
}
}

0 comments on commit c1f1acb

Please sign in to comment.