summaryrefslogtreecommitdiff
path: root/releng/migrations/0003_release_populate_last_modified.py
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2015-04-15 01:40:48 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2015-04-15 01:40:48 -0400
commitcdff1a234be0d625c5c824707dbae32ffa6a76dd (patch)
treea9e029f2a98ad72e64d9e09a922ec39ab502a75b /releng/migrations/0003_release_populate_last_modified.py
parentf18a6c809f45e71175ced6050d7e57bf4e7e89ba (diff)
parent90873ef7de4bf842fbf6971836a373c555cfcbaa (diff)
Merge branch 'master-nomake'
Diffstat (limited to 'releng/migrations/0003_release_populate_last_modified.py')
-rw-r--r--releng/migrations/0003_release_populate_last_modified.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/releng/migrations/0003_release_populate_last_modified.py b/releng/migrations/0003_release_populate_last_modified.py
new file mode 100644
index 00000000..ec7b6fda
--- /dev/null
+++ b/releng/migrations/0003_release_populate_last_modified.py
@@ -0,0 +1,21 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import models, migrations
+
+def forwards(apps, schema_editor):
+ Release = apps.get_model('releng', 'Release')
+ Release.objects.update(last_modified=models.F('created'))
+
+def backwards(apps, schema_editor):
+ pass
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('releng', '0002_release_last_modified'),
+ ]
+
+ operations = [
+ migrations.RunPython(forwards, backwards)
+ ]