File tree Expand file tree Collapse file tree
kotlin/com/github/quiltservertools/ledger Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ kotlin.code.style=official
22org.gradle.jvmargs =-Xmx2G
33
44# Mod Properties
5- modVersion = 1.3.21
5+ modVersion = 1.3.22
66mavenGroup = com.github.quiltservertools
77modId = ledger
88modName = Ledger
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ object DatabaseSpec : ConfigSpec() {
1515 val batchDelay by optional<Int >(10 )
1616 val logSQL by optional<Boolean >(false )
1717 val location by optional<String ?>(null )
18+ val updateSchema by optional<Boolean >(false )
1819}
1920
2021fun Config.getDatabasePath (): Path {
Original file line number Diff line number Diff line change @@ -122,10 +122,12 @@ object DatabaseManager {
122122 Tables .Sources ,
123123 Tables .Worlds ,
124124 )
125- try {
126- exec(" CREATE INDEX IF NOT EXISTS actions_time ON actions(time)" )
127- } catch (e: java.sql.SQLException ) {
128- logWarn(" Could not create actions_time index (MySQL 8.0.12+ required if using MySQL): ${e.message} " )
125+ if (config[DatabaseSpec .updateSchema]) {
126+ try {
127+ exec(" CREATE INDEX IF NOT EXISTS actions_time ON actions(time)" )
128+ } catch (e: java.sql.SQLException ) {
129+ logWarn(" Could not create actions_time index (MySQL 8.0.12+ required if using MySQL): ${e.message} " )
130+ }
129131 }
130132 logInfo(" Tables created" )
131133 }
Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ batchSize = 1000
1111batchDelay = 10
1212# The location of the database file. Defaults to the world folder if not specified
1313# location = "./custom-dir"
14+ # Allow the database format to be updated on startup (can be slow)
15+ updateSchema = false
1416
1517[search ]
1618# Number of actions to show per page
You can’t perform that action at this time.
0 commit comments