Skip to content

fix: record the user_hackathons migration on main (#254) - #255

Merged
Jose-Gael-Cruz-Lopez merged 1 commit into
mainfrom
fix/issue-254-record-user-hackathons-migration
Aug 10, 2026
Merged

fix: record the user_hackathons migration on main (#254)#255
Jose-Gael-Cruz-Lopez merged 1 commit into
mainfrom
fix/issue-254-record-user-hackathons-migration

Conversation

@Jose-Gael-Cruz-Lopez

Copy link
Copy Markdown
Collaborator

Closes #254.

public.user_hackathons exists in the live Supabase project right now — table, RLS policies, grants — but nothing on main recorded that it does. This lands the migration that creates it, plus the README section explaining why it's a special case.

The drift

The migration lived only on the unmerged draft branch for #236; main's migrations stopped at 20260722192614. That left the repo disagreeing with the database in two directions:

  • Production is ahead of main. Rebuild a database from main's migrations and you get a schema missing a table production has.
  • The migration isn't in the ledger. It's absent from supabase_migrations.schema_migrations, so a future supabase db push would try to replay a create table for a table that already exists.

Why land it separately from #236

The drift isn't contingent on that feature merging. #236 is still a draft and blocked behind a Clerk↔Supabase dashboard configuration (#235); the repo shouldn't keep misdescribing the database until that resolves.

This changes nothing about the running system

The migration is idempotent against the live database, so recording it here is inert:

statement re-run behaviour
create table if not exists public.user_hackathons no-op
4 × create policy each preceded by drop policy if exists
alter table … enable row level security no-op when already enabled
comment on table idempotent
grant / revoke (×4) idempotent

Also included

The README section documenting the divergence. The migration header already points at it — "See README for the divergence" — but that section only existed on the same draft branch, so on main the reference dangled. It records that the file was applied through the SQL Editor rather than apply_migration, why ls returns one more entry than the recorded ledger, and how to reconcile if a CLI is ever adopted. The README change is purely additive: 27 insertions, 0 deletions.

Deliberately not included

20260810064325_atomic_tracker_upsert.sql, the atomic-upsert fix from #236. It defines a function only tracker-store.ts calls, and that file exists on #236's branch alone — landing it here would add a function nothing on main uses. It stays with the PR that needs it.

Still outstanding after this

This does not reconcile the ledger. main and production now agree about what exists; supabase_migrations.schema_migrations still has no row for this version. If a Supabase CLI or MCP is ever wired up, that reconciliation — insert the version, or re-run through apply_migration against a fresh database — is still needed, and the README now says so.

🤖 Generated with Claude Code

public.user_hackathons exists in the live Supabase project — table, RLS
policies and grants — but nothing on main said so. The migration that creates
it lived only on the unmerged draft branch for #236, and main's migrations
stopped at 20260722192614.

That left the repo drifting from the database in two directions at once:
rebuild a database from main's migrations and you get a schema missing a table
production has, and the migration is absent from
supabase_migrations.schema_migrations, so a future `supabase db push` would try
to replay a create table for a table that already exists.

Bringing the file onto main independently of #236, because the drift is not
contingent on that feature landing. The migration is idempotent against the
live database — `create table if not exists`, every `create policy` preceded by
`drop policy if exists`, and the grants, revokes and `enable row level
security` are all no-ops on a re-run — so recording it here changes nothing
about the running system.

Also brings the README section documenting the divergence, which the migration
header already points at ("See README for the divergence") but which only
existed on the same draft branch. It records that this file was applied through
the SQL Editor rather than `apply_migration`, why `ls` returns one more entry
than the recorded ledger, and how to reconcile if a CLI is ever wired up.

Deliberately does NOT bring 20260810064325_atomic_tracker_upsert.sql. That one
defines a function only tracker-store.ts calls, which exists on #236's branch
alone; landing it here would add a function nothing on main uses.

This does not by itself apply anything to the database. The table is already
there, so main and production now agree — but the ledger reconciliation
described in the README is still outstanding if a CLI is adopted.

Closes #254

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Aug 10, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
hackhq Ready Ready Preview Aug 10, 2026 6:50am

Request Review

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
hackhq 68ed90f Commit Preview URL

Branch Preview URL
Aug 10 2026, 06:52 AM

@Jose-Gael-Cruz-Lopez
Jose-Gael-Cruz-Lopez merged commit bd98d89 into main Aug 10, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Schema drift: user_hackathons exists in production but not in main's migrations

1 participant