-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8366 from cfpb/wagtail6
Upgrade to Wagtail 6.0
- Loading branch information
Showing
23 changed files
with
54 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
cfgov/v1/migrations/0033_wagtailsearch_querydailyhits_index_fix.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Generated by Django 4.2.11 on 2024-04-29 12:46 | ||
|
||
from django.db import migrations | ||
|
||
# This is a one-off fix to convert an existing unique index on a Wagtail | ||
# table into a unique constraint. See internal Design-and-Content-Team#389 | ||
# for a description of the problem with a different constraint, | ||
# https://github.com/cfpb/consumerfinance.gov/pull/8066 for the fix this is | ||
# based on. | ||
# | ||
# The mode QueryDailyHits is and its `UNIQUE` constraints are removed in | ||
# wagtail.search.migrations.0008_remove_query_and_querydailyhits_models.py | ||
# in Wagtail 6.0. This migration will prepare our database for the constraint's | ||
# constraint's removal. | ||
|
||
table_name = "wagtailsearch_querydailyhits" | ||
index_name = "idx_17496_wagtailsearch_querydailyhits_query_id_4e12c633921cb0c" | ||
unique_together = "query_id, date" | ||
|
||
# nosec used here to suppress Bandit warning about this raw SQL. | ||
# https://bandit.readthedocs.io/en/latest/plugins/b608_hardcoded_sql_expressions.html | ||
sql = f""" | ||
DO $$ BEGIN | ||
IF EXISTS (SELECT FROM pg_indexes WHERE indexname='{index_name}') THEN | ||
DROP INDEX {index_name}; | ||
ALTER TABLE {table_name} ADD CONSTRAINT {index_name} UNIQUE({unique_together}); | ||
END IF; | ||
END $$; | ||
""".strip() # nosec B608 | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("v1", "0032_alter_browsepage_content"), | ||
] | ||
|
||
run_before = [ | ||
("wagtailsearch", "0008_remove_query_and_querydailyhits_models"), | ||
] | ||
|
||
operations = [ | ||
migrations.RunSQL(sql, migrations.RunSQL.noop, elidable=True) | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -148,7 +148,6 @@ class CFGOVPage(Page): | |
), | ||
], | ||
blank=True, | ||
use_json_field=True, | ||
) | ||
|
||
# Panels | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
wagtail==5.2.3 | ||
wagtail==6.0.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters