You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your project Javascript or Typescript: Typescript
Describe the bug
We have a production instance of the project running in the cloud. Whilst developing, we had set local env var to the production database. Locally the codebase was checked out to an old commit that didn't include a number of new collection types that had been added. We ran the dev server locally and because the code didn't have the new collection types and db env vars were pointing to production, the corresponding tables related to the missing collection types were dropped. A lot of important data was lost and without any warning or notification.
Steps to reproduce the behavior
run locally with local database
check out old commit that doesn't include some recently added collection types
run again locally and tables are dropped.
Expected behavior
I would expect that if data is going to be dropped that a notification is given something along the lines of "The following tables with data are going to be dropped: X, Y, Z. Do you want to continue Y/n".
I'm pretty shocked at how easy it was to lose data.
The text was updated successfully, but these errors were encountered:
This is intended and there are several warnings in the documentation.
We can't add interactive messages to the terminal or it would break ci/cd and this type of schema migration is exactly what it should be doing in production.
You should NEVER connect any application to a prod database like that. Take a snapshot or a backup, pull it locally and connect with a local dev database.
Thanks for the response. I disagree that no safeguards could be put in place because of CI/CD. Perhaps prompts could be added if running dev server or a check for the presence of an env var (e.g. IS_CICD) to determine whether it's appropriate to show warnings when data is going to be dropped from the database.
Bug report
Required System information
Describe the bug
We have a production instance of the project running in the cloud. Whilst developing, we had set local env var to the production database. Locally the codebase was checked out to an old commit that didn't include a number of new collection types that had been added. We ran the dev server locally and because the code didn't have the new collection types and db env vars were pointing to production, the corresponding tables related to the missing collection types were dropped. A lot of important data was lost and without any warning or notification.
Steps to reproduce the behavior
Expected behavior
I would expect that if data is going to be dropped that a notification is given something along the lines of "The following tables with data are going to be dropped: X, Y, Z. Do you want to continue Y/n".
I'm pretty shocked at how easy it was to lose data.
The text was updated successfully, but these errors were encountered: