Skip to content

fix(db): make purchase_history.ramp_step and purchase_executions.error NOT NULL #1484

Closed

Description

@cristim

Found by the second review of #1473 (#1465).

Problem: two columns are nullable in the schema, but the Go scanners read them into plain values. The Go writers never store NULL, so a NULL can only come from a legacy row or a hand-written SQL row. When one appears, the whole listing fails to scan.

Fix at the root: one migration, numbered above main's highest at merge time, that:

  • backfills NULL to 0 for ramp_step and to '' for error;
  • sets both columns to NOT NULL DEFAULT.

Include a real-Postgres migration test (up and down) and a check that existing rows survive. Until it lands, scan ramp_step through sql.NullInt32, the same way #1473 handles error.

Activity

  1. IAmJSD commented on Oct 26, 2026

    @IAmJSD
    Collaborator

    Claiming: working on this

  2. self-assigned this
    on Oct 26, 2026
  3. added a commit that references this issue on Oct 26, 2026
    2e8a9a2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions