Skip to content

Commit 8bc3f9f

Browse files
committed
Remove unnecessary migration steps
1 parent 3207600 commit 8bc3f9f

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

app/src/main/kotlin/com/simplemobiletools/musicplayer/databases/SongsDatabase.kt

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import com.simplemobiletools.musicplayer.interfaces.*
1010
import com.simplemobiletools.musicplayer.models.*
1111
import com.simplemobiletools.musicplayer.objects.MyExecutor
1212

13-
@Database(entities = [Track::class, Playlist::class, QueueItem::class, Artist::class, Album::class], version = 13)
13+
@Database(entities = [Track::class, Playlist::class, QueueItem::class, Artist::class, Album::class], version = 12)
1414
abstract class SongsDatabase : RoomDatabase() {
1515

1616
abstract fun SongsDao(): SongsDao
@@ -43,7 +43,6 @@ abstract class SongsDatabase : RoomDatabase() {
4343
.addMigrations(MIGRATION_9_10)
4444
.addMigrations(MIGRATION_10_11)
4545
.addMigrations(MIGRATION_11_12)
46-
.addMigrations(MIGRATION_12_13)
4746
.build()
4847
}
4948
}
@@ -181,14 +180,10 @@ abstract class SongsDatabase : RoomDatabase() {
181180
execSQL("DROP TABLE artists")
182181
execSQL("ALTER TABLE artists_new RENAME TO artists")
183182
execSQL("CREATE UNIQUE INDEX IF NOT EXISTS `index_artists_id` ON `artists` (`id`)")
184-
}
185-
}
186-
}
187183

188-
private val MIGRATION_12_13 = object: Migration(12, 13) {
189-
override fun migrate(database: SupportSQLiteDatabase) {
190-
database.execSQL("ALTER TABLE tracks ADD COLUMN date_added INTEGER NOT NULL DEFAULT 0")
191-
database.execSQL("ALTER TABLE albums ADD COLUMN date_added INTEGER NOT NULL DEFAULT 0")
184+
database.execSQL("ALTER TABLE tracks ADD COLUMN date_added INTEGER NOT NULL DEFAULT 0")
185+
database.execSQL("ALTER TABLE albums ADD COLUMN date_added INTEGER NOT NULL DEFAULT 0")
186+
}
192187
}
193188
}
194189
}

0 commit comments

Comments
 (0)