-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
fix: Migration error with cms.0027_title_placeholders_data_migration #8249
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
Conversation
Reviewer's GuideThe PR updates the 0027 migration by adding a Sequence Diagram: Optimized Placeholder Query in Migration 0027sequenceDiagram
participant MS as "Migration Script (0027_title_placeholders_data_migration.py)"
participant ORM as "Django ORM"
participant DB as "Database"
MS->>ORM: Build QuerySet for Old Placeholders with .only("pk"):
Note right of ORM: Query includes: <br/> .filter(pk__in=old_placeholder_ids) <br/> .annotate(plugin_count=models.Count('cmsplugin')) <br/> .only("pk")
ORM->>DB: Execute SQL Query (Optimized to select only 'pk' and aggregated 'plugin_count')
DB-->>ORM: Return results (primary keys and plugin_count for each)
ORM-->>MS: Provide QuerySet with Placeholder objects (only 'pk' field loaded from DB + 'plugin_count' annotation)
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello! Thank you for your contribution! 🎉
As it's your first contribution, be sure to check out the contribution docs.
We invite you to join us on our Discord Server!
Welcome aboard ⛵️!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @jmit-modern - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Co-authored-by: keni <v-keni@kexp.org> Co-authored-by: Fabian Braun <fsbraun@gmx.de>
Co-authored-by: keni <v-keni@kexp.org> Co-authored-by: Fabian Braun <fsbraun@gmx.de>
fix #8243: Migration error with cms.0027_title_placeholders_data_migration
main
Summary by Sourcery
Bug Fixes:
.only("pk")
to the placeholder queryset in the 0027 migration to prevent loading unsupported fields during data migration.