Skip to content

Apply migration 00033 (oracle columns on formulacode_task_overrides) to production #71

Closed

Description

@ArjunS07

Problem

Migration supabase/migrations/00033_task_overrides_oracle_columns.sql is in main (commit 33bebfa, from #29), but it is not applied to the production database.

  • A query for the column fails: column formulacode_task_overrides.oracle_speedup does not exist (PostgREST error 42703, checked on 2026-10-20).
  • No code on main reads or writes these columns yet. The oracle_speedup names in docker/templates/parser.py are local variables, not database columns. So nothing fails today.
  • The schema in main and the schema in production are different. The first code that stores oracle results in the database will fail until the migration runs.

What the migration does

It adds 5 nullable columns to formulacode_task_overrides and one check constraint. It is additive and safe to run again (add column if not exists, and the constraint is added only when it is missing):

alter table formulacode_task_overrides
  add column if not exists oracle_speedup     double precision,
  add column if not exists oracle_trust       text,
  add column if not exists oracle_benchmarks  jsonb,
  add column if not exists oracle_provenance  jsonb,
  add column if not exists oracle_measured_at timestamptz;
-- plus: check constraint fto_oracle_trust_check (oracle_trust in 'trusted', 'marginal', 'untrusted', or null)

Request

  1. Apply 00033_task_overrides_oracle_columns.sql to production with the usual migration process. The REST API cannot run schema changes; use the Supabase SQL editor or supabase db push.
  2. Check the result with a select on the new columns:
    GET /rest/v1/formulacode_task_overrides?select=oracle_speedup,oracle_trust,oracle_benchmarks,oracle_provenance,oracle_measured_at&limit=1
    

Related

Activity

  1. atharvas commented on Oct 20, 2026

    @atharvas
    Member

    Migration 00033_task_overrides_oracle_columns.sql is applied to production (2026-10-20). It ran directly against the Postgres that db.formulacode.org tunnels to.

    Checks after the migration:

    • formulacode_task_overrides has the 5 new columns: oracle_speedup (double precision), oracle_trust (text), oracle_benchmarks (jsonb), oracle_provenance (jsonb), oracle_measured_at (timestamptz).
    • Constraint fto_oracle_trust_check exists: CHECK (oracle_trust IS NULL OR oracle_trust IN ('trusted', 'marginal', 'untrusted')).
    • The 5 existing rows are unchanged.
    • The request from this issue now returns data through both 127.0.0.1 and https://db.formulacode.org, not error 42703:
      GET /rest/v1/formulacode_task_overrides?select=oracle_speedup,oracle_trust,oracle_benchmarks,oracle_provenance,oracle_measured_at&limit=1
      → [{"oracle_speedup": null, "oracle_trust": null, "oracle_benchmarks": null, "oracle_provenance": null, "oracle_measured_at": null}]
      

    Note: supabase_migrations.schema_migrations records versions only up to 00022, so do not use supabase db push on this database. It would try to run 00023 and later again.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions