Some Postgres tables get dropped periodically

Stack: Heroku with Postgres DB

Hey! My Admins works perfectly. You can fetch/update/delete data, add new models, republish etc (in dev and prod).

But periodically, something happens that causes 2 issues in our production Admin:

  1. The posts table will get wiped from the database
  2. The pages tab in the Content Manager is inaccessible (page turns white, browser console shows can’t access properties of undefined error)

The post and page model still show up in the Content-Type Builder. All other data is good. After redeploying, the post table returns (with no data), and the page tabs work as normal (all data in tact).

Don’t know with certainty, but **this wipe seems to happen around midnight EST **(will be fine before sleeping then wiped the next day). We’ve gotten the same wipe consistently for 3-4 days.

We’ve checked the logs but don’t see anything about dropping tables or deleting data (attached some logs just in case)

Other things to note:

  1. Data persists after redeploying.
  2. Data persists after restarting all dynos.
  3. We use an SQLite database locally, so the problem isn’t local data/schema changes reflected in prod.
  4. The prod db is 100% using Postgres, not SQLite (see first pic).
  5. I’ve been the only person working on this, so don’t think the issue stems from multiple people accessing/updating the prod admin.

Has anyone ran into something similar? Thanks!

This topic has been created from a Discord post (1258130358520778782) to give it more visibility.
It will be on Read-Only mode here.
Join the conversation on Discord

some Postgres tables get dropped periodically

some Postgres tables get randomly dropped

the clue imho is with inconsistency with schemas and data in DB. Cuz Strapi is a data schema related app - it wipes all data accordinglly to data schema. If you migrate new data to your DB without apropriate changes in schema files - it will wipe you data from db at a build time

Thanks for the reply! The thing is, the data doesn’t get wiped at build time. I’ll redeploy and have all the data persist, then it’ll be wiped the next day. Thinking it’s some validation/migration that happens periodically, but I can’t pin down what it is.

We’re trying Strapi Cloud to see if the issue is with Heroku. If the problem is there, it’ll probably be a data<>schema issue.