Skip to content

Commit 262cde9

Browse files
committed
Add modified_date to ImportedFile.
This makes it easier to see when files have been updated so we can reindex smarter
1 parent bc248aa commit 262cde9

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# -*- coding: utf-8 -*-
2+
# Generated by Django 1.11.16 on 2018-11-01 14:37
3+
from __future__ import unicode_literals
4+
5+
from django.db import migrations, models
6+
7+
8+
class Migration(migrations.Migration):
9+
10+
dependencies = [
11+
('projects', '0029_add_additional_languages'),
12+
]
13+
14+
operations = [
15+
migrations.AddField(
16+
model_name='importedfile',
17+
name='modified_date',
18+
field=models.DateTimeField(auto_now=True, verbose_name='Modified date'),
19+
),
20+
]

readthedocs/projects/models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -943,6 +943,7 @@ class ImportedFile(models.Model):
943943
path = models.CharField(_('Path'), max_length=255)
944944
md5 = models.CharField(_('MD5 checksum'), max_length=255)
945945
commit = models.CharField(_('Commit'), max_length=255)
946+
modified_date = models.DateTimeField(_('Modified date'), auto_now=True)
946947

947948
def get_absolute_url(self):
948949
return resolve(project=self.project, version_slug=self.version.slug, filename=self.path)

0 commit comments

Comments
 (0)