diff options
author | Elrond <elrond+mediagoblin.org@samba-tng.org> | 2012-02-04 20:55:55 +0100 |
---|---|---|
committer | Elrond <elrond+mediagoblin.org@samba-tng.org> | 2012-02-18 12:35:30 +0100 |
commit | e61ab0998b77eaf18268001fd2d70917c3cd3e37 (patch) | |
tree | 78b034c490a8c8cdbe880c8b1327ef1c4eb8e1a2 /mediagoblin/db/mongo/migrations.py | |
parent | 38816c66078fe679dc4b51b545d15d331712bcb4 (diff) | |
download | mediagoblin-e61ab0998b77eaf18268001fd2d70917c3cd3e37.tar.lz mediagoblin-e61ab0998b77eaf18268001fd2d70917c3cd3e37.tar.xz mediagoblin-e61ab0998b77eaf18268001fd2d70917c3cd3e37.zip |
Drop pre-rendered html: User.bio_html
After a bit of discussion, we decided to drop the
pre-rendered html from the database and render it on
the fly.
In another step, we will use some proper caching method to
cache this stuff.
This commit affects the User.bio_html part.
Diffstat (limited to 'mediagoblin/db/mongo/migrations.py')
-rw-r--r-- | mediagoblin/db/mongo/migrations.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/mediagoblin/db/mongo/migrations.py b/mediagoblin/db/mongo/migrations.py index 261e21a5..74a810c1 100644 --- a/mediagoblin/db/mongo/migrations.py +++ b/mediagoblin/db/mongo/migrations.py @@ -115,3 +115,14 @@ def mediaentry_add_license(database): Add the 'license' field for entries that don't have it. """ add_table_field(database, 'media_entries', 'license', None) + + +@RegisterMigration(9) +def user_remove_bio_html(database): + """ + Drop bio_html again and calculate things on the fly (and cache) + """ + database['users'].update( + {'bio_html': {'$exists': True}}, + {'$unset': {'bio_html': 1}}, + multi=True) |