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

Permit Field Name Conflicts To Ease Existing Field Migrations #332

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

matthewshirley
Copy link

@matthewshirley matthewshirley commented Jan 28, 2023

Summary

This PR is to enable easier migration of existing fields by disabling the proxy fields using a new setting, PARLER_PERMIT_FIELD_NAME_CONFLICTS.

Further Information

  • The documentation for making existing fields translatable does not work when executing the makemigration command, as an error is thrown with the message The model '{shared_model.__name__}' already has a field named '{name}'.

  • The proposal is to skip this error and not contribute the proxy class only when the PARLER_PERMIT_FIELD_NAME_CONFLICTS setting is True. This means the "old field" can exist, while the django-parler schema can be created. Translations from django-parler must be sourced from the translations relationship.

  • This enables a developer to perform a 3-step zero downtime migration, or slowly roll in django-parler.

Issues

Closes #263
Closes #254

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