[PR #3378] [MERGED] Add db migration management infratructure #3953

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

📋 Pull Request Information

Original PR: https://github.com/advplyr/audiobookshelf/pull/3378
Author: @mikiher
Created: 9/4/2024
Status: Merged
Merged: 9/10/2024
Merged by: @advplyr

Base: masterHead: migration-manager


📝 Commits (5)

  • 3f93b93 Add db migration management infratructure
  • b3ce300 Fix some packaging and dependency issues
  • 8a28029 Make migration management more robust
  • 6fb1202 Put umzug in server/libs and remove unneeded dependencies from it
  • 7cbf9de Update migrations jsdocs

📊 Changes

24 files changed (+1745 additions, -159 deletions)

View changed files

📝 package-lock.json (+42 -159)
📝 package.json (+1 -0)
📝 server/Database.js (+11 -0)
server/libs/umzug/LICENSE (+21 -0)
server/libs/umzug/index.js (+31 -0)
server/libs/umzug/storage/contract.js (+18 -0)
server/libs/umzug/storage/index.js (+24 -0)
server/libs/umzug/storage/json.js (+61 -0)
server/libs/umzug/storage/memory.js (+17 -0)
server/libs/umzug/storage/mongodb.js (+31 -0)
server/libs/umzug/storage/sequelize.js (+85 -0)
server/libs/umzug/templates.js (+32 -0)
server/libs/umzug/types.js (+12 -0)
server/libs/umzug/umzug.js (+386 -0)
server/managers/MigrationManager.js (+275 -0)
server/migrations/changelog.md (+7 -0)
server/migrations/readme.md (+49 -0)
test/server/managers/MigrationManager.test.js (+503 -0)
test/server/managers/migrations/v1.0.0-migration.js (+9 -0)
test/server/managers/migrations/v1.1.0-migration.js (+9 -0)

...and 4 more files

📄 Description

This adds migration management infrastructure, based on the design and discussion here.

This is for initial review - please don't merge this yet. Currently missing:

  • I have not e2e-tested this yet with actual migrations (it runs, but I only ran it with an empty migrations directetory)
  • I have not modified backup yet to store and restore the migrations directory.

Other than that, I think this is pretty complete.

Please review carefully - I tried to unit test everything thoroughly, but of course I might have missed stuff.

Also, please review the readme and changlog files in server/migrations


🔄 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/3378 **Author:** [@mikiher](https://github.com/mikiher) **Created:** 9/4/2024 **Status:** ✅ Merged **Merged:** 9/10/2024 **Merged by:** [@advplyr](https://github.com/advplyr) **Base:** `master` ← **Head:** `migration-manager` --- ### 📝 Commits (5) - [`3f93b93`](https://github.com/advplyr/audiobookshelf/commit/3f93b93d9e9e25c0c75476c5584cc465cf8f9fea) Add db migration management infratructure - [`b3ce300`](https://github.com/advplyr/audiobookshelf/commit/b3ce300d32592a59f99deb33bc24867955955c17) Fix some packaging and dependency issues - [`8a28029`](https://github.com/advplyr/audiobookshelf/commit/8a280298092203a7ed83213e6ffacb09f836e14d) Make migration management more robust - [`6fb1202`](https://github.com/advplyr/audiobookshelf/commit/6fb1202c1cacf5a29066463f32a8b9fdee8ab7a9) Put umzug in server/libs and remove unneeded dependencies from it - [`7cbf9de`](https://github.com/advplyr/audiobookshelf/commit/7cbf9de8ca4c5f4fb561a0f7468195dd7ae14ecf) Update migrations jsdocs ### 📊 Changes **24 files changed** (+1745 additions, -159 deletions) <details> <summary>View changed files</summary> 📝 `package-lock.json` (+42 -159) 📝 `package.json` (+1 -0) 📝 `server/Database.js` (+11 -0) ➕ `server/libs/umzug/LICENSE` (+21 -0) ➕ `server/libs/umzug/index.js` (+31 -0) ➕ `server/libs/umzug/storage/contract.js` (+18 -0) ➕ `server/libs/umzug/storage/index.js` (+24 -0) ➕ `server/libs/umzug/storage/json.js` (+61 -0) ➕ `server/libs/umzug/storage/memory.js` (+17 -0) ➕ `server/libs/umzug/storage/mongodb.js` (+31 -0) ➕ `server/libs/umzug/storage/sequelize.js` (+85 -0) ➕ `server/libs/umzug/templates.js` (+32 -0) ➕ `server/libs/umzug/types.js` (+12 -0) ➕ `server/libs/umzug/umzug.js` (+386 -0) ➕ `server/managers/MigrationManager.js` (+275 -0) ➕ `server/migrations/changelog.md` (+7 -0) ➕ `server/migrations/readme.md` (+49 -0) ➕ `test/server/managers/MigrationManager.test.js` (+503 -0) ➕ `test/server/managers/migrations/v1.0.0-migration.js` (+9 -0) ➕ `test/server/managers/migrations/v1.1.0-migration.js` (+9 -0) _...and 4 more files_ </details> ### 📄 Description This adds migration management infrastructure, based on the design and discussion [here](https://github.com/mikiher/audiobookshelf/discussions/2). This is for initial review - please don't merge this yet. Currently missing: - I have not e2e-tested this yet with actual migrations (it runs, but I only ran it with an empty migrations directetory) - I have not modified backup yet to store and restore the migrations directory. Other than that, I think this is pretty complete. Please review carefully - I tried to unit test everything thoroughly, but of course I might have missed stuff. Also, please review the readme and changlog files in `server/migrations` --- <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:42 +02:00
adam closed this issue 2026-04-25 00:17:42 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#3953