-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: drop django-mptt in favour of django-tree-queries
Django-Tree-Queries works with recursive CTEs (common table expressions) to deal with hierarchical relationships, generally achieving the same result, but without the `right`, `left` and `tree_id` fields. Django-MPTT has been unmaintained for several years, and we're suspecting some subtle bugs in it that we can't really reproduce or verify right now. Anyway it's a good time to get rid of it. Note: Some old migrations needed to be changed, as we cannot refer to MPTT fields anymore. They were essentially regular foreign keys however, so this won't break the database. BREAKING! This breaks if Emeis is used as a Django app directly, and depends on any of the MPTT API / features.
- Loading branch information
Showing
18 changed files
with
634 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Generated by Django 3.2.25 on 2024-06-03 14:17 | ||
|
||
import django.db.models.deletion | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("emeis_core", "0010_scope_full_name"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterModelOptions( | ||
name="scope", | ||
options={"ordering": ["full_name"]}, | ||
), | ||
migrations.RemoveField( | ||
model_name="scope", | ||
name="level", | ||
), | ||
migrations.RemoveField( | ||
model_name="scope", | ||
name="lft", | ||
), | ||
migrations.RemoveField( | ||
model_name="scope", | ||
name="rght", | ||
), | ||
migrations.RemoveField( | ||
model_name="scope", | ||
name="tree_id", | ||
), | ||
migrations.AlterField( | ||
model_name="scope", | ||
name="parent", | ||
field=models.ForeignKey( | ||
blank=True, | ||
null=True, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name="children", | ||
to="emeis_core.scope", | ||
verbose_name="parent", | ||
), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.