-
Notifications
You must be signed in to change notification settings - Fork 195
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
offer MYSQL_COMPATIBILITY setting to remove unique from the model #267
Conversation
docs/index.rst
Outdated
------------------- | ||
MySQL has a limit for indices and therefore the `registration_id` field cannot be made unique in MySQL. | ||
We detect the database backend and remove the unique constraint for MySQL in the migration files. However, | ||
to ensure that the constraint is removed from the actual model you have to add the following to your settings: |
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.
Should make it clear somehow this is only an edge case and most people even if using mysql won't need this (and mention what the use case would be)
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.
improved it and explained my alternative solution that even lets mysql users enjoy an indexed registration_id
), | ||
] | ||
] | ||
if not SETTINGS["MYSQL_COMPATIBILITY"] |
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.
Why explicitly check this? It should skip it if it's mysql anway?
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.
btw, i would be happy with only merging the readme part regarding a custom model and ditch the code & setting part. for us the custom model is enough as soon as it's released. |
I wouldn't want everyone to have to migrate to custom model because of this and there seems to be a lot of people having issues with this. |
Fixes #266. Funny enough I just saw the commit with the swappable model and it seems possible to do this now:
with setting
FCM_DJANGO_FCMDEVICE_MODEL = '...CustomFCMDevice'
.