incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject [1/3] git commit: [#5023] add migration for new queue_empty field
Date Wed, 03 Oct 2012 20:50:09 GMT
Updated Branches:
  refs/heads/master e8469834c -> 78ab60f9a


[#5023] add migration for new queue_empty field


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/78ab60f9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/78ab60f9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/78ab60f9

Branch: refs/heads/master
Commit: 78ab60f9a0d7251effc238b98dc110706876da8e
Parents: c3be42b
Author: Dave Brondsema <dbrondsema@geek.net>
Authored: Wed Oct 3 20:05:34 2012 +0000
Committer: Dave Brondsema <dbrondsema@geek.net>
Committed: Wed Oct 3 20:05:34 2012 +0000

----------------------------------------------------------------------
 scripts/migrations/029-set-mailbox-queue_empty.py |   18 ++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/78ab60f9/scripts/migrations/029-set-mailbox-queue_empty.py
----------------------------------------------------------------------
diff --git a/scripts/migrations/029-set-mailbox-queue_empty.py b/scripts/migrations/029-set-mailbox-queue_empty.py
new file mode 100644
index 0000000..c7773cc
--- /dev/null
+++ b/scripts/migrations/029-set-mailbox-queue_empty.py
@@ -0,0 +1,18 @@
+import logging
+
+from allura import model as M
+
+log = logging.getLogger(__name__)
+
+
+def main():
+    M.Mailbox.query.update({'queue': []},
+                           {'$set': {'queue_empty': True}},
+                           multi=True)
+
+    M.Mailbox.query.update({'queue': {'$ne': []}},
+                           {'$set': {'queue_empty': False}},
+                           multi=True)
+
+if __name__ == '__main__':
+    main()


Mime
View raw message