-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
feat: upgrading django-history with lots of new migrations. #32840
Conversation
Sandbox with new migrations.
|
7e42475
to
cb50ec0
Compare
|
||
#### django-simple-history## | ||
# disable indexing on date field via django-simple-history. | ||
SIMPLE_HISTORY_DATE_INDEX = False |
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.
Added the variable to avoid indexing on date field.
Many queries use history_date as a filter. The as_of queries combine this with the original model's primary key to extract point-in-time snapshots of history. By default the history_date field is indexed. You can control this behavior using settings.py.
#disable indexing on history_date
SIMPLE_HISTORY_DATE_INDEX = False
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 do we want to disable it?
2454f12
to
b85acbd
Compare
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.
Is there any way to separate the upgrades and the migrations, and indeed to separate the migrations from each other? Thinking what would happen if we had to do a rollback
|
||
#### django-simple-history## | ||
# disable indexing on date field via django-simple-history. | ||
SIMPLE_HISTORY_DATE_INDEX = False |
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 do we want to disable it?
@rgraber https://github.com/jazzband/django-simple-history/blob/master/CHANGES.rst#310-2022-04-09
On enabling it will add index and generates more migrations and that will be db level change. |
Yes, its possible. |
It sounds like kind of a pain but I do think it is worth it. I'd be nervous about trying to roll this back all at once |
Closing this as this got implemented in chunks |
Issue details edx/edx-arch-experiments#376
https://django-simple-history.readthedocs.io/en/latest/#section-1
Upgrading the package to
3.1.1
The updated package includes some enhancements that introduce new migrations. However, these migrations do not involve any alterations to the existing fields; instead, they are focused on meta changes aimed at improving the ordering functionality.
AlterModelOptions
AlterModelOptions
Related PR jazzband/django-simple-history#862 ( this pr shows the get_latest_by usage )
Similar PR merged in credentials PR
edx-platform generates lots of migrations within
edx-app
and also in other packages. I have updated other packages also here and these also contains few migrations.So far did't bump and release any package. Once finalizing all testing I will merge and release together.