Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Migration Manager not recognizing migrations from before current version #3415

Closed
nichwall opened this issue Sep 13, 2024 · 0 comments · Fixed by #3418
Closed

[Bug]: Migration Manager not recognizing migrations from before current version #3415

nichwall opened this issue Sep 13, 2024 · 0 comments · Fixed by #3418
Labels
bug Something isn't working

Comments

@nichwall
Copy link
Contributor

nichwall commented Sep 13, 2024

What happened?

I am working on getting my first migration written (for the series duplication bug). Upgrading a database from 2.12.3 to 2.13.4 with a test migration occurring in 2.13.2 does not run the migration script. I assume this is because the migrationMeta table is being created with the current server version, so the migration manager sees the newly created table as having the same value as the current server version.

This may cause problems with future upgrades, or if people are upgrading from older server versions to a version after a migration occurred.

I am basing the migration script soley off of the README in the migrations folder, so I could be doing something wrong with the version numbers in my testing.

What did you expect to happen?

All migration scripts to run between previous and current version when creation of migrationsMeta table. When creating the table, the "old version" can be assumed to be 2.13.4 or similar.

Manually editing the versions in the table and then running the server again does correctly run the migration.

Steps to reproduce the issue

  1. Use older database
  2. Create migration script that targets a version between old database and current server version, without having upgraded to a server version that has the MigrationManager
  3. Observe migration script does not run

Audiobookshelf version

v2.13.4-edge

How are you running audiobookshelf?

Built from source

What OS is your Audiobookshelf server hosted from?

Linux

If the issue is being seen in the UI, what browsers are you seeing the problem on?

None

Logs

[2024-09-13 10:58:04.236] INFO: [MigrationManager] Database is already up to date.
[2024-09-13 10:58:04.346] INFO: [Database] Db initialized with models: user, library, libraryFolder, book, podcast, podcastEpisode, libraryItem, mediaProgress, series, bookSeries, author, bookAuthor, collection, collectionBook, playlist, playlistMediaItem, device, playbackSession, feed, feedEpisode, setting, customMetadataProvider, mediaItemShare
[2024-09-13 10:58:04.351] DEBUG: Set Log Level to DEBUG
[2024-09-13 10:58:04.373] INFO: [Database] Server upgrade detected from 2.12.3 to 2.13.4

Additional Notes

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant