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

Add support for archiving DB to SQLite #1104

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open

Add support for archiving DB to SQLite #1104

wants to merge 12 commits into from

Conversation

Mr0grog
Copy link
Member

@Mr0grog Mr0grog commented Aug 10, 2023

⚠️ Work in progress! ⚠️

This adds a rake command to export the contents of the DB into a SQLite file for public archiving. It's mostly a pretty straightforward copy of every table/row, but we skip tables that are irrelevant for a public data set (administrative things like GoodJob tables, users, imports, etc.), drop columns with user data, and do some basic conversions.

Part of edgi-govdata-archiving/web-monitoring#170

For changes/annotations, we probably want to just select relevant annotations, like the important changes (make sure we have them all in the DB first, see https://github.com/edgi-govdata-archiving/web-monitoring-processing/blob/main/web_monitoring/cli/annotations_import.py), and only import those and the changes they apply to.

Copy link
Member Author

@Mr0grog Mr0grog left a comment

Choose a reason for hiding this comment

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

Need to come back around and actually get this done. Now that we’ve upgraded to Rails 8 there are some useful builtins and some code can be deleted.

app/lib/data_helpers.rb Outdated Show resolved Hide resolved
lib/tasks/export_sqlite.rake Outdated Show resolved Hide resolved
@Mr0grog
Copy link
Member Author

Mr0grog commented Jan 10, 2025

Happy to discover I already imported all the sheet-based significant annotations to the DB after starting this PR (over a year ago, ugh): edgi-govdata-archiving/web-monitoring-processing#853

So I just need to test this a bit more, but it should basically be ready to go.

@Mr0grog Mr0grog marked this pull request as ready for review January 10, 2025 00:50
Work in progress! This adds a rake command to export the contents of the DB into a SQLite file for public archiving. It's *mostly* a pretty straightforward copy of every table/row, but we skip tables that are irrelevant for a public data set (administrative things like GoodJob tables, users, imports, etc.), drop columns with user data, and do some basic conversions.

Part of edgi-govdata-archiving/web-monitoring#170
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.

1 participant