chore(migrations): renumber 108_add_backup_paths to 109 to avoid upstream collision
upstream/beta independently shipped 108_seed_sl_email_template_translations.js
(Slovenian email template translations) using the migration number
this branch had already claimed for 108_add_backup_paths.js. Knex's
filename-based ordering would have caused both to attempt the slot
at merge time.
Renamed via `git mv` so file history is preserved. All five
references updated in lockstep:
- backend/src/services/_backupPathsBoot.js (require + comments)
- backend/src/services/backupService.js (LEGACY_BACKUP_PATHS comment)
- 3 integration test files (require + "migration 108" prose)
- migration's own header comment, with a paragraph explaining the
rename so reviewers don't wonder why the number jumped
**No data-migration impact for installs that already ran the
108-named version** (Ralf's beta, primarily): the migration's body
is idempotent — createTable is guarded by `hasTable`, and the seed
uses `onConflict('path').ignore()`. So when 109 runs against an
install whose backup_paths table is already populated, both the
schema step and the seed step no-op cleanly. The orphaned
`108_add_backup_paths.js` row in the `migrations` tracking table
sits harmlessly alongside the new `109_add_backup_paths.js` row.
No data lost, no double-insert, no schema drift. Mechanical rename
ahead of the PR opening.
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
* **Why this exists**
|
||||
*
|
||||
* Knex won't re-run an applied migration, so once migration
|
||||
* 108_add_backup_paths.js has run, any later default we want to add
|
||||
* 109_add_backup_paths.js has run, any later default we want to add
|
||||
* (a new subdirectory shipped by a future feature) would never reach
|
||||
* already-deployed installs. The historical fix for this kind of
|
||||
* "schema is fine, seed drifted" problem is the boot-time self-heal
|
||||
@@ -14,7 +14,7 @@
|
||||
*
|
||||
* **Authoritative list**
|
||||
*
|
||||
* The list of defaults lives on migration 108 itself
|
||||
* The list of defaults lives on migration 109 itself
|
||||
* (`DEFAULT_PATHS` export) — one source of truth that both the
|
||||
* migration and this seeder read. Tests assert these two stay in
|
||||
* lockstep.
|
||||
@@ -22,14 +22,14 @@
|
||||
* **Failure semantics**
|
||||
*
|
||||
* If the table doesn't exist yet (migrations haven't run, fresh
|
||||
* install before migration 108 lands, etc.) we no-op and log. The
|
||||
* install before migration 109 lands, etc.) we no-op and log. The
|
||||
* walker has a hard-coded `LEGACY_DEFAULTS` fallback for the same
|
||||
* reason — defense in depth so "Run Backup Now" can never silently
|
||||
* ship a files-only manifest because of a seed issue. See
|
||||
* `backupService.js` getFilesToBackupInternal.
|
||||
*/
|
||||
|
||||
const { DEFAULT_PATHS } = require('../../migrations/core/108_add_backup_paths');
|
||||
const { DEFAULT_PATHS } = require('../../migrations/core/109_add_backup_paths');
|
||||
|
||||
let booted = false;
|
||||
|
||||
@@ -45,7 +45,7 @@ async function seedBackupPathsAtBoot(db, logger) {
|
||||
if (booted) return { seeded: [] };
|
||||
|
||||
if (!(await db.schema.hasTable('backup_paths'))) {
|
||||
log.warn('backup_paths table missing at boot — self-heal skipped (migration 108 may not have run yet)');
|
||||
log.warn('backup_paths table missing at boot — self-heal skipped (migration 109 may not have run yet)');
|
||||
return { seeded: [] };
|
||||
}
|
||||
|
||||
|
||||
@@ -419,7 +419,7 @@ async function scanDirectory(dirPath, fileList, basePath, excludePatterns = [])
|
||||
|
||||
/**
|
||||
* Hard-coded fallback when `backup_paths` is missing/empty. Mirrors
|
||||
* the canonical seed in migration 108 — kept here as defense in depth
|
||||
* the canonical seed in migration 109 — kept here as defense in depth
|
||||
* so the walker can never silently degrade to "no directories scanned"
|
||||
* because of a seed problem.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user