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/
Join a community of builders sharing skills and resources to make EV conversions more fun, affordable, and achievable through teamwork.
Was this page helpful?