Skip to content

Commit

Permalink
Supprime le champ inutile Comment.update_index_date
Browse files Browse the repository at this point in the history
On se sert du champ search_engine_requires_index pour savoir s'il faut
réindexer un objet.
  • Loading branch information
philippemilink committed Oct 13, 2024
1 parent 56719a5 commit 53bc4d4
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 15 deletions.
9 changes: 0 additions & 9 deletions fixtures/topics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
17 changes: 17 additions & 0 deletions zds/forum/migrations/0025_remove_update_index_date.py
Original file line number Diff line number Diff line change
@@ -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",
),
]
3 changes: 0 additions & 3 deletions zds/forum/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
17 changes: 17 additions & 0 deletions zds/utils/migrations/0027_remove_update_index_date.py
Original file line number Diff line number Diff line change
@@ -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",
),
]
3 changes: 0 additions & 3 deletions zds/utils/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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="")
Expand Down

0 comments on commit 53bc4d4

Please sign in to comment.