From 53bc4d431ce0e8db5198e0baf06c85047fb5c0d5 Mon Sep 17 00:00:00 2001 From: Philippe MILINK Date: Sat, 5 Oct 2024 18:31:14 +0200 Subject: [PATCH] Supprime le champ inutile Comment.update_index_date MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On se sert du champ search_engine_requires_index pour savoir s'il faut réindexer un objet. --- fixtures/topics.yaml | 9 --------- .../migrations/0025_remove_update_index_date.py | 17 +++++++++++++++++ zds/forum/models.py | 3 --- .../migrations/0027_remove_update_index_date.py | 17 +++++++++++++++++ zds/utils/models.py | 3 --- 5 files changed, 34 insertions(+), 15 deletions(-) create mode 100644 zds/forum/migrations/0025_remove_update_index_date.py create mode 100644 zds/utils/migrations/0027_remove_update_index_date.py diff --git a/fixtures/topics.yaml b/fixtures/topics.yaml index 45eb91fd81..3a5b7c2042 100644 --- a/fixtures/topics.yaml +++ b/fixtures/topics.yaml @@ -6,7 +6,6 @@ forum: 10 author: 3 pubdate: 2013-12-21 13:20:30 - update_index_date: 2013-12-21 13:20:30 last_message: 1 - model: forum.Topic pk: 2 @@ -16,7 +15,6 @@ forum: 3 author: 3 pubdate: 2013-12-21 13:20:30 - update_index_date: 2013-12-21 13:20:30 last_message: 2 - model: forum.Topic pk: 3 @@ -25,7 +23,6 @@ forum: 2 author: 3 pubdate: 2013-12-21 13:20:30 - update_index_date: 2013-12-21 13:20:30 last_message: 4 - model: forum.Topic pk: 4 @@ -34,7 +31,6 @@ forum: 12 author: 3 pubdate: 2014-01-05 18:20:30 - update_index_date: 2013-12-21 13:20:30 last_message: 5 - model: forum.Post pk: 1 @@ -49,7 +45,6 @@ like: 42 dislike: 0 pubdate: 2013-12-21 13:20:30 - update_index_date: 2013-12-21 13:20:30 position: 1 - model: forum.Post pk: 2 @@ -64,7 +59,6 @@ like: 3 dislike: 12 pubdate: 2013-12-21 13:20:30 - update_index_date: 2013-12-21 13:20:30 position: 1 - model: forum.Post pk: 3 @@ -79,7 +73,6 @@ like: 42 dislike: 0 pubdate: 2013-12-21 13:22:30 - update_index_date: 2013-12-21 13:20:30 position: 2 - model: forum.Post pk: 4 @@ -94,7 +87,6 @@ like: 0 dislike: 0 pubdate: 2013-12-21 13:20:30 - update_index_date: 2013-12-21 13:20:30 position: 1 - model: forum.Post pk: 5 @@ -275,5 +267,4 @@ like: 1337 dislike: 0 pubdate: 2014-01-05 18:20:30 - update_index_date: 2013-12-21 13:20:30 position: 1 diff --git a/zds/forum/migrations/0025_remove_update_index_date.py b/zds/forum/migrations/0025_remove_update_index_date.py new file mode 100644 index 0000000000..446d092a28 --- /dev/null +++ b/zds/forum/migrations/0025_remove_update_index_date.py @@ -0,0 +1,17 @@ +# Generated by Django 4.2.16 on 2024-10-02 23:09 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ("forum", "0024_rename_search_fields"), + ] + + operations = [ + migrations.RemoveField( + model_name="topic", + name="update_index_date", + ), + ] diff --git a/zds/forum/models.py b/zds/forum/models.py index 7250513c97..35c7cfc949 100644 --- a/zds/forum/models.py +++ b/zds/forum/models.py @@ -202,9 +202,6 @@ class Meta: "Post", null=True, related_name="last_message", verbose_name="Dernier message", on_delete=models.SET_NULL ) pubdate = models.DateTimeField("Date de création", auto_now_add=True) - update_index_date = models.DateTimeField( - "Date de dernière modification pour la réindexation partielle", auto_now=True, db_index=True - ) solved_by = models.ForeignKey( User, verbose_name="Utilisateur ayant noté le sujet comme résolu", diff --git a/zds/utils/migrations/0027_remove_update_index_date.py b/zds/utils/migrations/0027_remove_update_index_date.py new file mode 100644 index 0000000000..84ceb776c0 --- /dev/null +++ b/zds/utils/migrations/0027_remove_update_index_date.py @@ -0,0 +1,17 @@ +# Generated by Django 4.2.16 on 2024-10-02 23:09 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ("utils", "0026_customsession"), + ] + + operations = [ + migrations.RemoveField( + model_name="comment", + name="update_index_date", + ), + ] diff --git a/zds/utils/models.py b/zds/utils/models.py index 088a42cf29..9a6337fbf2 100644 --- a/zds/utils/models.py +++ b/zds/utils/models.py @@ -399,9 +399,6 @@ class Meta: pubdate = models.DateTimeField("Date de publication", auto_now_add=True, db_index=True) update = models.DateTimeField("Date d'édition", null=True, blank=True) - update_index_date = models.DateTimeField( - "Date de dernière modification pour la réindexation partielle", auto_now=True, db_index=True - ) is_visible = models.BooleanField("Est visible", default=True) text_hidden = models.CharField("Texte de masquage ", max_length=80, default="")