Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to protect a table #51

Open
steve-chavez opened this issue Jun 9, 2023 · 0 comments
Open

Ability to protect a table #51

steve-chavez opened this issue Jun 9, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@steve-chavez
Copy link
Member

Problem

Doing DROP TABLE on a table with a lot of data is usually a big mistake. This can even happen unintentionally with some migration systems.

See https://old.reddit.com/r/Supabase/comments/139wxfo/prevent_dropping_of_tables/

Solution

Only allow dropping the table if the table has a small amount of data. This should be configurable.

The logic can be:

  • User does DROP TABLE tbl. We query the estimated rows this table has, if larger than X refuse and say "Denied. If you're sure about this TRUNCATE the table first". Once truncated it will be lower than X rows so just allow dropping then.
  • For cases that escape this logic, there's backups. Which should be fast to restore bc there are few rows.
@steve-chavez steve-chavez added the enhancement New feature or request label Jun 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant