summaryrefslogtreecommitdiffstats
path: root/mirrors
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2013-12-14 18:24:57 +0100
committerDan McGee <dan@archlinux.org>2013-12-14 18:24:57 +0100
commita116f0d94221f72fa14d90ec77b9777efbfada65 (patch)
treefb3a6163fb9654f5397186d88e2ef64c3ed36b17 /mirrors
parentd83e0842053b3a4a4dfb31f373d34ecf1e0c5ce2 (diff)
downloadarchweb-a116f0d94221f72fa14d90ec77b9777efbfada65.tar.gz
archweb-a116f0d94221f72fa14d90ec77b9777efbfada65.tar.xz
Add update query for extracting Flyspray bug number
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'mirrors')
-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')