summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mirrors/migrations/0027_auto__add_field_mirror_bug.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/mirrors/migrations/0027_auto__add_field_mirror_bug.py b/mirrors/migrations/0027_auto__add_field_mirror_bug.py
index 5772733..f7304ba 100644
--- a/mirrors/migrations/0027_auto__add_field_mirror_bug.py
+++ b/mirrors/migrations/0027_auto__add_field_mirror_bug.py
@@ -9,6 +9,14 @@ class Migration(SchemaMigration):
db.add_column(u'mirrors_mirror', 'bug',
self.gf('django.db.models.fields.PositiveIntegerField')(null=True),
keep_default=False)
+ # UPDATE mirrors_mirror m
+ # SET bug = (
+ # SELECT extracted::int FROM (
+ # SELECT id, substring(notes from 'FS#([\d]+)') AS extracted FROM mirrors_mirror
+ # ) a
+ # WHERE extracted IS NOT NULL AND a.id = m.id
+ # )
+ # WHERE notes LIKE '%FS#%';
def backwards(self, orm):
db.delete_column(u'mirrors_mirror', 'bug')