Merge pull request #3417 from nichwall/series_cleanup_2

Add: series migration to be unique
This commit is contained in:
advplyr 2024-10-12 15:48:04 -05:00 committed by GitHub
commit e58d7db03b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 553 additions and 9 deletions

View file

@ -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)