Tables wiped
Disaster struck today. Five tables in the project I've been working weeks on suddenly appeared empty. I use the Supabase MCP. I went to check Backups and discovered that being on the free tier meant there wasn't any backup. I've reported the incident to Supabase and pleaded to somehow restore the tables that got blown away somehow. I asked my coding AI for help in figuring out what happened.
Gemini CLI: Okay, we have a prime suspect. The search found one highly relevant file: /database/migrations/001_initial_schema.js.
A file named "initial_schema.js" is almost certainly a script used to set up the database tables
from a clean slate. It's very common for such scripts to include commands to DROP (delete) existing
tables before recreating them, which would explain exactly why all your tables are now empty.
✦ I've analyzed the 001_initial_schema.js file, and we've found the "smoking gun."
This script is a migration file for managing your entire dynamine database schema. It contains two key
functions:
This confirms exactly how your data was lost. A command was run that executed either the up() or
down() function from this script, which wiped your tables. This wasn't a bug, but the script working
as designed.
To be absolutely certain, I will now read the contents of the database/schema.sql file that the up()
function executes. This will confirm if it contains the DROP TABLE commands.
One other clue: Gemini reports: I've reviewed both the root and the project package.json files.
I'm feeling that sick feeling that more than two weeks of effort may have been destroyed. Any help would be welcome. I made the newb mistake of not realizing the free tier didn't have any backup.
For anyone who cares, this facet of work is related to my main project: https://electr0motiv.com/
electr0motiv - The Collaborative EV Conversion Guild
Join a community of builders sharing skills and resources to make EV conversions more fun, affordable, and achievable through teamwork.
6 Replies
@automaticjack If you go to Pro, every user that has done so says there are 7 daily backups there even from when Free. Minimum risk is $25 for the month. It is not documented though.
I'd gladly pay $25 just the get the data back. Hopefully Supabase can advise on that. Has anyone else ever gotten a backup by going Pro?
This is a user helping user forum.
It highly likely works. Some one in the past few days did it. And it has worked for many dozens I've helped.
Thanks so much for that tip. Would love to hear from anyone who was able to recover from this kind of table deletion by getting the Pro account.
You are not likely going to get another response. But you can search here and there are dozens of cases.
https://discord.com/channels/839993398554656828/1412511611003863101/1412557807504457840
https://github.com/orgs/supabase/discussions/38491
FYI, upgrading did enable me to restore my lost tables. Thank you very much for the advice!