mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-10-30 22:07:57 +01:00 
			
		
		
		
	| @@ -6,15 +6,13 @@ class MigrationStrategyFactory( | ||||
| ) { | ||||
|  | ||||
|     fun create(old: Int, new: Int): MigrationStrategy { | ||||
|         val versions = (old + 1)..new | ||||
|         val strategy = when { | ||||
|             old == 0 -> InitialMigrationStrategy( | ||||
|                 strategy = DefaultMigrationStrategy(factory, migrationCompletedListener, Migrator.scope), | ||||
|             ) | ||||
|  | ||||
|             old >= new -> NoopMigrationStrategy(false) | ||||
|             else -> VersionRangeMigrationStrategy( | ||||
|                 versions = versions, | ||||
|                 versions = (old + 1)..new, | ||||
|                 strategy = DefaultMigrationStrategy(factory, migrationCompletedListener, Migrator.scope), | ||||
|             ) | ||||
|         } | ||||
|   | ||||
| @@ -10,7 +10,7 @@ import kotlinx.coroutines.runBlocking | ||||
| object Migrator { | ||||
|  | ||||
|     private var result: Deferred<Boolean>? = null | ||||
|     val scope = CoroutineScope(Dispatchers.Main + Job()) | ||||
|     val scope = CoroutineScope(Dispatchers.IO + Job()) | ||||
|  | ||||
|     fun initialize( | ||||
|         old: Int, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user