You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(api): make database seeder resilient to missing optional fields
The database seeding process was crashing with a "Missing variable" error. This was caused by a conflict between the models' `toJson` method (which uses `includeIfNull: false` and omits keys for null values) and the `postgres` driver's requirement that all named SQL parameters exist in the provided parameters map.
This change refactors the seeding logic to manually ensure that parameter maps for `categories` and `headlines` always contain keys for all optional/nullable columns (e.g., `description`, `icon_url`, `content`), setting their value to `null` if they are not already present. This makes the seeding process robust against incomplete fixture data and permanently resolves the startup error.
0 commit comments