[PR #3416] [CLOSED] Set intitial database version in migrationsMeta to 0.0.0 #3966

Closed
opened 2026-04-25 00:17:45 +02:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/advplyr/audiobookshelf/pull/3416
Author: @advplyr
Created: 9/13/2024
Status: Closed

Base: masterHead: migrations-first-upgrade


📝 Commits (2)

  • 2f83e86 Set intitial database version in migrationsMeta to 0.0.0
  • 1f37d4a Update MigrationManager unit test

📊 Changes

2 files changed (+6 additions, -3 deletions)

View changed files

📝 server/managers/MigrationManager.js (+5 -2)
📝 test/server/managers/MigrationManager.test.js (+1 -1)

📄 Description

fixes #3415

The issue is that the migrations get copied because the initial maxVersion is 0.0.0 but the migrations don't run because the databaseVersion matches the serverVersion.

Setting the databaseVersion to 0.0.0 on create will have all the migrations be run.

I'm not sure if I'm missing anything here so would appreciate if you can take a look @mikiher

I tested this by going back to a database state before the migrationsMeta and SequelizeMeta.

Create a migration file for v2.13.4 and update the package.json version to v2.13.5.

This now runs the migration file for v2.13.4


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/advplyr/audiobookshelf/pull/3416 **Author:** [@advplyr](https://github.com/advplyr) **Created:** 9/13/2024 **Status:** ❌ Closed **Base:** `master` ← **Head:** `migrations-first-upgrade` --- ### 📝 Commits (2) - [`2f83e86`](https://github.com/advplyr/audiobookshelf/commit/2f83e86d69922caf1d73631e1711e0449570b981) Set intitial database version in migrationsMeta to 0.0.0 - [`1f37d4a`](https://github.com/advplyr/audiobookshelf/commit/1f37d4a7d587a1d8408f2cdec40e5149aa793f64) Update MigrationManager unit test ### 📊 Changes **2 files changed** (+6 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `server/managers/MigrationManager.js` (+5 -2) 📝 `test/server/managers/MigrationManager.test.js` (+1 -1) </details> ### 📄 Description fixes #3415 The issue is that the migrations get copied because the initial maxVersion is 0.0.0 but the migrations don't run because the databaseVersion matches the serverVersion. Setting the databaseVersion to 0.0.0 on create will have all the migrations be run. I'm not sure if I'm missing anything here so would appreciate if you can take a look @mikiher I tested this by going back to a database state before the migrationsMeta and SequelizeMeta. Create a migration file for v2.13.4 and update the package.json version to v2.13.5. This now runs the migration file for v2.13.4 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2026-04-25 00:17:45 +02:00
adam closed this issue 2026-04-25 00:17:45 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#3966