Skip to content

Add submissions compatibility migration to add missing columns (including name)#192

Open
badjoke-lab wants to merge 1 commit into
mainfrom
codex/fix-500-error-on-post-/api/submissions
Open

Add submissions compatibility migration to add missing columns (including name)#192
badjoke-lab wants to merge 1 commit into
mainfrom
codex/fix-500-error-on-post-/api/submissions

Conversation

@badjoke-lab

Copy link
Copy Markdown
Owner

Motivation

  • POST /api/submissions was failing with Postgres error 42703 for missing column name because the API INSERT list in insertSubmissionToDb expects columns that are absent in some DB deployments.
  • Provide a schema-only compatibility migration so older/partial schemas gain the columns the API requires without changing validation, UI, or tests.

Description

  • Add migrations/compat_submissions_columns.sql which runs an ALTER TABLE IF EXISTS public.submissions and ADD COLUMN IF NOT EXISTS for all columns referenced by the API INSERT (including name, country, accepted_chains, submitted_by, payload, lat, lng, etc.).
  • Chose types consistent with existing conventions (TEXT, TEXT[], JSONB, DOUBLE PRECISION, BOOLEAN, TIMESTAMPTZ) and left columns nullable where appropriate.
  • Document a one-line manual apply step in docs/db.md so operators can run psql "$DATABASE_URL" -f migrations/compat_submissions_columns.sql to apply the migration.
  • No changes were made to submission spec/validation/UI/tests.

Testing

  • No automated tests were run for this change (no CI/test execution was performed).

Codex Task

@vercel

vercel Bot commented Jan 31, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cryptopaymap-v2 Error Error Jan 31, 2026 11:53am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant