From 31867efcb9b9c4f19ca8a7e59dfcbd8eb6157525 Mon Sep 17 00:00:00 2001 From: Luca <102960244+Luca-Timo@users.noreply.github.com> Date: Thu, 11 Jun 2026 16:57:48 +0200 Subject: [PATCH] fix(accounting): migration 127 must not insert created_at/updated_at into app_settings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- .../core/127_seed_expenses_flag_and_accounting_settings.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/migrations/core/127_seed_expenses_flag_and_accounting_settings.js b/backend/migrations/core/127_seed_expenses_flag_and_accounting_settings.js index 3931acc4..f30b4b5c 100644 --- a/backend/migrations/core/127_seed_expenses_flag_and_accounting_settings.js +++ b/backend/migrations/core/127_seed_expenses_flag_and_accounting_settings.js @@ -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(), }); } }