mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 05:23:35 +00:00
models: Add request_timestamp field to ScheduledMessage table.
This just records the time when the user created the request to schedule a message or set a reminder. This would be unused but is future-proofing against a world where we decide to edit the strings or UI to show when you asked for the thing.
This commit is contained in:
@@ -339,7 +339,7 @@ DATE_FIELDS: dict[TableName, list[Field]] = {
|
||||
"date_deleted",
|
||||
],
|
||||
"zerver_savedsnippet": ["date_created"],
|
||||
"zerver_scheduledmessage": ["scheduled_timestamp"],
|
||||
"zerver_scheduledmessage": ["scheduled_timestamp", "request_timestamp"],
|
||||
"zerver_stream": ["date_created"],
|
||||
"zerver_namedusergroup": ["date_created"],
|
||||
"zerver_useractivityinterval": ["start", "end"],
|
||||
|
||||
18
zerver/migrations/0698_scheduledmessage_request_timestamp.py
Normal file
18
zerver/migrations/0698_scheduledmessage_request_timestamp.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 5.1.8 on 2025-04-24 05:47
|
||||
|
||||
import django.utils.timezone
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
("zerver", "0697_empty_topic_name_for_dms_from_third_party_imports"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name="scheduledmessage",
|
||||
name="request_timestamp",
|
||||
field=models.DateTimeField(default=django.utils.timezone.now),
|
||||
),
|
||||
]
|
||||
@@ -152,6 +152,7 @@ class ScheduledMessage(models.Model):
|
||||
delivered = models.BooleanField(default=False)
|
||||
delivered_message = models.ForeignKey(Message, null=True, on_delete=CASCADE)
|
||||
has_attachment = models.BooleanField(default=False, db_index=True)
|
||||
request_timestamp = models.DateTimeField(default=timezone_now)
|
||||
|
||||
# Metadata for messages that failed to send when their scheduled
|
||||
# moment arrived.
|
||||
|
||||
Reference in New Issue
Block a user