Skip to content

armgit / TREK

Public Imported from GitHub
0

The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.

refactor(db): drop the unused raw document provider seeder

Maurice6ef6a7efd2cd
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.<label>`, the same way the photo provider form
@@ -337,31 +336,3 @@ export const DOCUMENT_PROVIDER_FIELDS: ProviderFieldRow[] = [
sort_order: 5,
},
];
-
-export function seedDocumentProviders(db: Database.Database): void {
- const insertProvider = db.prepare(
- 'INSERT OR IGNORE INTO document_providers (id, name, description, icon, enabled, sort_order) VALUES (?, ?, ?, ?, 0, ?)',
- );
- for (const p of DOCUMENT_PROVIDERS) insertProvider.run(p.id, p.name, p.description, p.icon, p.sort_order);
-
- const insertField = db.prepare(
- `INSERT OR IGNORE INTO document_provider_fields
- (provider_id, field_key, label, input_type, placeholder, hint, required, secret, sort_order)
- VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)`,
- );
- for (const f of DOCUMENT_PROVIDER_FIELDS) {
- insertField.run(
- f.provider_id,
- f.field_key,
- f.label,
- f.input_type,
- f.placeholder,
- f.hint,
- f.required,
- f.secret,
- f.sort_order,
- );
- }
-}
-
-export const DOCUMENT_PROVIDER_SEED_IDS = DOCUMENT_PROVIDERS.map((p) => p.id);