-
Notifications
You must be signed in to change notification settings - Fork 2
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
chore: (WIP) Added script to drop tables from DB #170
base: master
Are you sure you want to change the base?
chore: (WIP) Added script to drop tables from DB #170
Conversation
|
Thanks @robrap, I’ve updated the script to operate only on the predefined list of tables instead of taking input from the user. It now checks if a table has had any changes in the last 12 months before proceeding to drop either the foreign key or the table. The script ensures foreign keys are dropped only for the necessary tables before removing them to prevent dependency issues. Let me know if you have any feedback! |
Thanks.
Thank you. |
Currently, the script does not have an explicit dry-run mode, but I am working on adding that functionality. This will allow us to see which tables and foreign keys would be dropped without actually performing the deletions. Previously, the script simply printed the actions it performed, but I have replaced those with logging for better visibility. With the 1-year check, the dry-run mode will help identify any tables that have had activity within the last 12 months. Additionally, when running the script without dry-run, the logs will provide insight into why a table was skipped. |
Once your script is ready, you can run in dryrun mode locally (make sure it doesn't do anything harmful), and then in stage, to see the actual output and that it will delete what was predicted on the ticket. Thanks UPDATE: I'd recommend running dryrun in prod and edge too, but you can wait until you are actually ready to perform the clean-up. |
Make sure that the following steps are done before merging: