fix(accounting): migration 127 must not insert created_at/updated_at into app_settings

The app_settings table (per its migration schema) has no created_at/updated_at
columns — the canonical seed pattern (migration 103) inserts only
setting_key/setting_value/setting_type. Migration 127 wrongly added timestamps,
so the insert threw `SQLITE_ERROR: table app_settings has no column named
created_at` on every run of the migration suite. That broke the backend test
job (cascading through every suite that builds the schema) and the
Postgres-based fresh-install + schema-drift jobs.

Fix: drop the timestamp columns from the insert, matching migration 103.

Verified: full backend jest suite green (67 suites, 736 passed); migration
harness still green.
This commit is contained in:
Luca
2026-06-11 16:57:48 +02:00
parent 31280e1f7a
commit 31867efcb9
@@ -29,13 +29,14 @@ exports.up = async function (knex) {
// eslint-disable-next-line no-await-in-loop
const row = await knex('app_settings').where({ setting_key: s.key }).first();
if (!row) {
// NB: match the canonical app_settings seed pattern (migration 103) —
// setting_key/value/type only, NO created_at/updated_at (the table's
// migration schema has no such columns; including them errors).
// eslint-disable-next-line no-await-in-loop
await knex('app_settings').insert({
setting_key: s.key,
setting_value: JSON.stringify(s.value),
setting_type: 'accounting',
created_at: new Date(),
updated_at: new Date(),
});
}
}