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

Don't drop tables on import and specify database #838

Closed
wants to merge 2 commits into from

Conversation

WillNilges
Copy link
Collaborator

No description provided.

Copy link

codecov bot commented Feb 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.92%. Comparing base (8037c42) to head (a25e628).
Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #838   +/-   ##
=======================================
  Coverage   94.92%   94.92%           
=======================================
  Files          90       90           
  Lines        3841     3841           
=======================================
  Hits         3646     3646           
  Misses        195      195           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@WillNilges WillNilges changed the title Wdn/fix db import Don't drop tables on import and specify database Feb 21, 2025
# XXX (willnilges): Would it be better to use manage.py?
for ((i = num_tables - 1; i >= 0; i--));
do
$DOCKER_PG_COMMAND -c "DROP TABLE IF EXISTS ${tables[i]} CASCADE"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So looking at it now it's coming back to me why this might be needed. I think this should acutally be DELETE FROM for the type of export I generated for Sam :(

The import script ones were exported directly from psql with a command that might have been lost to time. These ones were generated with datagrip, and apparently they don't include the table definitions, just the insert statements. We should tune this script to whatever mechanized export process we want going forward (since the import script is no more)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh interesting, I didn't realize you had used a separate import mechanism. I agree that this process needs some work, but we should not rely on datagrip for this. My favorite thing to do would probably be to grab a backup from the S3 bucket, and write a script (perhaps a manage.py script) that could do the import/scramble/export in one shot.

@WillNilges
Copy link
Collaborator Author

This will require some noodling. Closing for now.

@WillNilges WillNilges closed this Mar 2, 2025
@WillNilges
Copy link
Collaborator Author

#845

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants