diff options
author | Christopher Allan Webber <cwebber@dustycloud.org> | 2011-07-24 23:12:46 -0500 |
---|---|---|
committer | Christopher Allan Webber <cwebber@dustycloud.org> | 2011-07-24 23:12:46 -0500 |
commit | 6b9ee0ca13b99ee20f9d0c680a950c6a7494a5a0 (patch) | |
tree | 66a96c0d5b14892eb35d6ab186dc249f1574d0f7 /mediagoblin/db/migrations.py | |
parent | 2684f341f5111fb831fb80e2b3b7ea7401cefc1c (diff) | |
download | mediagoblin-6b9ee0ca13b99ee20f9d0c680a950c6a7494a5a0.tar.lz mediagoblin-6b9ee0ca13b99ee20f9d0c680a950c6a7494a5a0.tar.xz mediagoblin-6b9ee0ca13b99ee20f9d0c680a950c6a7494a5a0.zip |
Store the task id of a processing action in the database.
Diffstat (limited to 'mediagoblin/db/migrations.py')
-rw-r--r-- | mediagoblin/db/migrations.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/mediagoblin/db/migrations.py b/mediagoblin/db/migrations.py index 6a8ebcf9..797d39de 100644 --- a/mediagoblin/db/migrations.py +++ b/mediagoblin/db/migrations.py @@ -52,3 +52,15 @@ def mediaentry_mediafiles_main_to_original(database): document['media_files']['original'] = original collection.save(document) + + +@RegisterMigration(3) +def mediaentry_add_queued_task_id(database): + """ + Add the 'queued_task_id' field for entries that don't have it. + """ + collection = database['media_entries'] + collection.update( + {'queued_task_id': {'$exists': False}}, + {'$set': {'queued_task_id': None}}, + multi=True) |