mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-31 16:24:45 +02:00
Ensure series-column-unique migration is idempotent
This commit is contained in:
parent
66b290577c
commit
8a7b5cc87d
2 changed files with 15 additions and 8 deletions
|
@ -38,6 +38,7 @@ class MigrationManager {
|
|||
if (!(await fs.pathExists(this.configPath))) throw new Error(`Config path does not exist: ${this.configPath}`)
|
||||
|
||||
this.migrationsDir = path.join(this.configPath, 'migrations')
|
||||
await fs.ensureDir(this.migrationsDir)
|
||||
|
||||
this.serverVersion = this.extractVersionFromTag(serverVersion)
|
||||
if (!this.serverVersion) throw new Error(`Invalid server version: ${serverVersion}. Expected a version tag like v1.2.3.`)
|
||||
|
@ -222,8 +223,6 @@ class MigrationManager {
|
|||
}
|
||||
|
||||
async copyMigrationsToConfigDir() {
|
||||
await fs.ensureDir(this.migrationsDir) // Ensure the target directory exists
|
||||
|
||||
if (!(await fs.pathExists(this.migrationsSourceDir))) return
|
||||
|
||||
const files = await fs.readdir(this.migrationsSourceDir)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue