From 2208faa71324ea65ebe1661e1f1f1b9827baf59c Mon Sep 17 00:00:00 2001 From: UsamaSadiq Date: Wed, 27 Sep 2023 16:07:41 +0500 Subject: [PATCH 1/2] chore: bump django-simple-history package version --- Makefile | 10 +--------- requirements/base.txt | 6 ++---- requirements/common_constraints.txt | 2 +- requirements/dev.txt | 6 ++---- requirements/doc.txt | 6 ++---- requirements/production.txt | 6 ++---- requirements/quality.txt | 6 ++---- requirements/test.txt | 6 ++---- requirements/validation.txt | 3 +-- 9 files changed, 15 insertions(+), 36 deletions(-) diff --git a/Makefile b/Makefile index 3d01e4c0..70bd581c 100644 --- a/Makefile +++ b/Makefile @@ -116,15 +116,7 @@ upgrade: piptools $(COMMON_CONSTRAINTS_TXT) ## update the requirements/*.txt fil # This is a temporary solution to override the real common_constraints.txt # In edx-lint, until the pyjwt constraint in edx-lint has been removed. # See BOM-271 for more details. - sed 's/pyjwt\[crypto\]<2.0.0//g' requirements/common_constraints.txt > requirements/common_constraints.tmp - mv requirements/common_constraints.tmp requirements/common_constraints.txt - sed 's/social-auth-core<4.0.3//g' requirements/common_constraints.txt > requirements/common_constraints.tmp - mv requirements/common_constraints.tmp requirements/common_constraints.txt - sed 's/edx-auth-backends<4.0.0//g' requirements/common_constraints.txt > requirements/common_constraints.tmp - mv requirements/common_constraints.tmp requirements/common_constraints.txt - sed 's/edx-drf-extensions<7.0.0//g' requirements/common_constraints.txt > requirements/common_constraints.tmp - mv requirements/common_constraints.tmp requirements/common_constraints.txt - sed 's/drf-jwt<1.19.1//g' requirements/common_constraints.txt > requirements/common_constraints.tmp + sed 's/django-simple-history==3.0.0//g' requirements/common_constraints.txt > requirements/common_constraints.tmp mv requirements/common_constraints.tmp requirements/common_constraints.txt # Make sure to compile files after any other files they include! pip-compile --upgrade --rebuild --allow-unsafe -o requirements/pip.txt requirements/pip.in diff --git a/requirements/base.txt b/requirements/base.txt index c5e4dc3b..fefe3daf 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -116,10 +116,8 @@ django-model-utils==4.3.1 # edx-rbac django-ses==3.5.0 # via -r requirements/base.in -django-simple-history==3.0.0 - # via - # -c requirements/common_constraints.txt - # -r requirements/base.in +django-simple-history==3.4.0 + # via -r requirements/base.in django-waffle==4.0.0 # via # -r requirements/base.in diff --git a/requirements/common_constraints.txt b/requirements/common_constraints.txt index d34ab34d..18ff1b20 100644 --- a/requirements/common_constraints.txt +++ b/requirements/common_constraints.txt @@ -25,7 +25,7 @@ Django<4.0 elasticsearch<7.14.0 # django-simple-history>3.0.0 adds indexing and causes a lot of migrations to be affected -django-simple-history==3.0.0 + # tox>4.0.0 isn't yet compatible with many tox plugins, causing CI failures in almost all repos. # Details can be found in this discussion: https://github.com/tox-dev/tox/discussions/1810 diff --git a/requirements/dev.txt b/requirements/dev.txt index d350a897..ac9c10f8 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -190,10 +190,8 @@ django-model-utils==4.3.1 # edx-rbac django-ses==3.5.0 # via -r requirements/validation.txt -django-simple-history==3.0.0 - # via - # -c requirements/common_constraints.txt - # -r requirements/validation.txt +django-simple-history==3.4.0 + # via -r requirements/validation.txt django-waffle==4.0.0 # via # -r requirements/validation.txt diff --git a/requirements/doc.txt b/requirements/doc.txt index 7350a4f2..23513438 100644 --- a/requirements/doc.txt +++ b/requirements/doc.txt @@ -180,10 +180,8 @@ django-model-utils==4.3.1 # edx-rbac django-ses==3.5.0 # via -r requirements/test.txt -django-simple-history==3.0.0 - # via - # -c requirements/common_constraints.txt - # -r requirements/test.txt +django-simple-history==3.4.0 + # via -r requirements/test.txt django-waffle==4.0.0 # via # -r requirements/test.txt diff --git a/requirements/production.txt b/requirements/production.txt index f7ce9cdd..125fd4e1 100644 --- a/requirements/production.txt +++ b/requirements/production.txt @@ -145,10 +145,8 @@ django-model-utils==4.3.1 # edx-rbac django-ses==3.5.0 # via -r requirements/base.txt -django-simple-history==3.0.0 - # via - # -c requirements/common_constraints.txt - # -r requirements/base.txt +django-simple-history==3.4.0 + # via -r requirements/base.txt django-waffle==4.0.0 # via # -r requirements/base.txt diff --git a/requirements/quality.txt b/requirements/quality.txt index 08154e53..43d3053e 100644 --- a/requirements/quality.txt +++ b/requirements/quality.txt @@ -157,10 +157,8 @@ django-model-utils==4.3.1 # edx-rbac django-ses==3.5.0 # via -r requirements/base.txt -django-simple-history==3.0.0 - # via - # -c requirements/common_constraints.txt - # -r requirements/base.txt +django-simple-history==3.4.0 + # via -r requirements/base.txt django-waffle==4.0.0 # via # -r requirements/base.txt diff --git a/requirements/test.txt b/requirements/test.txt index cca27557..1a589a92 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -166,10 +166,8 @@ django-model-utils==4.3.1 # edx-rbac django-ses==3.5.0 # via -r requirements/base.txt -django-simple-history==3.0.0 - # via - # -c requirements/common_constraints.txt - # -r requirements/base.txt +django-simple-history==3.4.0 + # via -r requirements/base.txt django-waffle==4.0.0 # via # -r requirements/base.txt diff --git a/requirements/validation.txt b/requirements/validation.txt index ca19868b..de3c6293 100644 --- a/requirements/validation.txt +++ b/requirements/validation.txt @@ -212,9 +212,8 @@ django-ses==3.5.0 # via # -r requirements/quality.txt # -r requirements/test.txt -django-simple-history==3.0.0 +django-simple-history==3.4.0 # via - # -c requirements/common_constraints.txt # -r requirements/quality.txt # -r requirements/test.txt django-waffle==4.0.0 From 48325623905e84fb116bc77dd9c35b774505ae9c Mon Sep 17 00:00:00 2001 From: UsamaSadiq Date: Wed, 27 Sep 2023 16:21:04 +0500 Subject: [PATCH 2/2] feat: new migrations due to history package upgrade --- .../migrations/0061_auto_20230927_1119.py | 41 +++++++++++++++++++ license_manager/settings/base.py | 3 ++ 2 files changed, 44 insertions(+) create mode 100644 license_manager/apps/subscriptions/migrations/0061_auto_20230927_1119.py diff --git a/license_manager/apps/subscriptions/migrations/0061_auto_20230927_1119.py b/license_manager/apps/subscriptions/migrations/0061_auto_20230927_1119.py new file mode 100644 index 00000000..2ae61fc2 --- /dev/null +++ b/license_manager/apps/subscriptions/migrations/0061_auto_20230927_1119.py @@ -0,0 +1,41 @@ +# Generated by Django 3.2.21 on 2023-09-27 11:19 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('subscriptions', '0060_historicalsubscriptionlicensesource'), + ] + + operations = [ + migrations.AlterModelOptions( + name='historicalcustomeragreement', + options={'get_latest_by': ('history_date', 'history_id'), 'ordering': ('-history_date', '-history_id'), 'verbose_name': 'historical Customer Agreement', 'verbose_name_plural': 'historical Customer Agreements'}, + ), + migrations.AlterModelOptions( + name='historicallicense', + options={'get_latest_by': ('history_date', 'history_id'), 'ordering': ('-history_date', '-history_id'), 'verbose_name': 'historical license', 'verbose_name_plural': 'historical licenses'}, + ), + migrations.AlterModelOptions( + name='historicalnotification', + options={'get_latest_by': ('history_date', 'history_id'), 'ordering': ('-history_date', '-history_id'), 'verbose_name': 'historical notification', 'verbose_name_plural': 'historical notifications'}, + ), + migrations.AlterModelOptions( + name='historicalproduct', + options={'get_latest_by': ('history_date', 'history_id'), 'ordering': ('-history_date', '-history_id'), 'verbose_name': 'historical product', 'verbose_name_plural': 'historical products'}, + ), + migrations.AlterModelOptions( + name='historicalsubscriptionlicensesource', + options={'get_latest_by': ('history_date', 'history_id'), 'ordering': ('-history_date', '-history_id'), 'verbose_name': 'historical subscription license source', 'verbose_name_plural': 'historical subscription license sources'}, + ), + migrations.AlterModelOptions( + name='historicalsubscriptionplan', + options={'get_latest_by': ('history_date', 'history_id'), 'ordering': ('-history_date', '-history_id'), 'verbose_name': 'historical Subscription Plan', 'verbose_name_plural': 'historical Subscription Plans'}, + ), + migrations.AlterModelOptions( + name='historicalsubscriptionplanrenewal', + options={'get_latest_by': ('history_date', 'history_id'), 'ordering': ('-history_date', '-history_id'), 'verbose_name': 'historical Subscription Plan Renewal', 'verbose_name_plural': 'historical Subscription Plan Renewals'}, + ), + ] diff --git a/license_manager/settings/base.py b/license_manager/settings/base.py index aa05d2f4..9a235bfb 100644 --- a/license_manager/settings/base.py +++ b/license_manager/settings/base.py @@ -435,3 +435,6 @@ # Django Admin Settings VALIDATE_FORM_EXTERNAL_FIELDS = True + +# disable indexing on history_date +SIMPLE_HISTORY_DATE_INDEX = False