From 6ef6a7efd2cd69fed47242cedbfaa0b21d1d8ccf Mon Sep 17 00:00:00 2001 From: Maurice Date: Thu, 8 Oct 2026 15:30:27 +0200 Subject: [PATCH] refactor(db): drop the unused raw document provider seeder seedDocumentProviders() had no caller left: the migration that creates the tables and DocumentProviderSeeder both import only the DOCUMENT_PROVIDERS and DOCUMENT_PROVIDER_FIELDS constants. Its two INSERT OR IGNORE statements were the only SQLite-only spellings in the file and had been baselined rather than removed. Deleting it lets the file leave the dialect baseline (13 hits down to 11) and the better-sqlite3 import allowlist in eslint.config.mjs, since nothing in it touches the driver any more. DOCUMENT_PROVIDER_SEED_IDS goes with it, it had no importer either. --- server/eslint.config.mjs | 3 +- server/scripts/dialect-baseline.json | 3 -- server/src/db/document-provider-seed.ts | 37 +++---------------------- 3 files changed, 5 insertions(+), 38 deletions(-) diff --git a/server/eslint.config.mjs b/server/eslint.config.mjs index 8136f4319..c31d68ded 100644 --- a/server/eslint.config.mjs +++ b/server/eslint.config.mjs @@ -273,12 +273,11 @@ export default tseslint.config( // outside the app's ORM and connection. 'src/nest/plugins/host/plugin-data.service.ts', // Frozen forever (ruling 7): invoked from inside numbered, already-shipped - // MikroORM migrations — rewriting either onto the ORM would change what a + // MikroORM migrations: rewriting it onto the ORM would change what a // re-run of an old migration against an old schema snapshot produces, // which is never done to a landed migration. Not Plan 4's or any future // plan's to touch. 'src/db/reseat-booked-nights.ts', - 'src/db/document-provider-seed.ts', ], rules: { 'no-restricted-imports': [ diff --git a/server/scripts/dialect-baseline.json b/server/scripts/dialect-baseline.json index e8be11e12..a10b22214 100644 --- a/server/scripts/dialect-baseline.json +++ b/server/scripts/dialect-baseline.json @@ -1,7 +1,4 @@ { - "src/db/document-provider-seed.ts": { - "insert-or": 2 - }, "src/db/entities/IdempotencyKeys.entity.ts": { "strftime": 1 }, diff --git a/server/src/db/document-provider-seed.ts b/server/src/db/document-provider-seed.ts index 6d51e6f50..52b2b171a 100644 --- a/server/src/db/document-provider-seed.ts +++ b/server/src/db/document-provider-seed.ts @@ -1,12 +1,11 @@ -import type Database from 'better-sqlite3'; /** * The five document providers and the fields their connection form asks for. * - * Shared by the migration that introduces the tables and by `seeds.ts`, so a - * fresh install and an upgraded one end up with the same rows. Both call sites - * use INSERT OR IGNORE, which is what lets an operator rename or re-sort a row - * without a later boot undoing it. + * Shared by the migration that introduces the tables and by + * DocumentProviderSeeder, so a fresh install and an upgraded one end up with + * the same rows. Both insert without overwriting an existing row, which is what + * lets an operator rename or re-sort a row without a later boot undoing it. * * `label` and `hint` are i18n key suffixes, never display text: the client * resolves them as `docsync.