Skip to content

Commit

Permalink
Fix up sqlite DB export (mozilla#15379)
Browse files Browse the repository at this point in the history
* Add VPN Resource Centre CMS models to the DB export

This got missed during development and my code review 🤦

* Ensure that the DB export doesn't contain any unpublished Pages

This covers pages which are still draft and have never been published
before, and also would cover pages that get retired in the future
  • Loading branch information
stevejalim authored Oct 24, 2024
1 parent 6320ecc commit 54584d8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions bin/export-db-to-sqlite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,9 @@ python manage.py dumpdata \
mozorg.WebvisionDoc \
mozorg.LeadershipPage \
newsletter.Newsletter \
products.VPNCallToActionSnippet \
products.VPNResourceCenterIndexPage \
products.VPNResourceCenterDetailPage \
externalfiles.ExternalFile \
security.Product \
security.SecurityAdvisory \
Expand Down Expand Up @@ -239,6 +242,10 @@ do
echo "Purged now-redundant data from: $table"
done

# Delete Wagtail Page records that are not marked as Live
sqlite3 $output_db "DELETE FROM wagtailcore_page WHERE live=0;"
echo "Purged Page records that are not marked as live any more"

# And to be sure that there are no relations pointing back to non-existent rows
echo "Preparing statements for nullifying columns in temporary sql file. (Output is hidden because it's captured from stdout)."

Expand Down

0 comments on commit 54584d8

Please sign in to comment.