The Prompt BakeryTemplates and prompts

Fix · Supabase and databases

Migration fails (already exists, does not exist, or order problems)

Blocks your work

What you may see

  • Running my SQL file stops with an error
  • The table or column already exists, or a relation does not exist

Most likely cause

The file runs against a database that is in a different state than the file expects, or it has a typo, or the files ran in the wrong order.

Check first (about two minutes)

  1. Is this your local test database or your live one? Check before anything else.
  2. Read the error line and number: the problem is usually right there.

The fix prompt

What you type here never leaves your browser. The search runs on this page, and nothing is sent to a server or to an AI.

Kept only in this browser, on this device. Keys and passwords are removed before anything is saved.

Prompt language

Paste it into Claude, ChatGPT, Gemini or Cursor, then follow what it says.

After you tried it, did it work?

Steps

  1. Do NOT run anything on the live database yet. Ask me which database the error came from.
  2. Reproduce the error on a local or test copy of the database.
  3. Fix the file so it can run safely once (use if not exists / if exists where right) and in the right order.
  4. Write a rollback file that undoes it. Give me both commands; I will run them myself on the live database after a backup.

Do not do this

  • Do not run the same SQL twice on live data "to see".
  • Do not skip a backup before changing the live database.
  • Do not run migrations on the live database yourself.
  • Do not drop tables or columns to make it pass.

Related

Try another entry

How can we help?

What do you need?
Your email, so we can reply (optional)Only enter your own email. We reply there.