diff options
author | tilly-Q <nattilypigeonfowl@gmail.com> | 2014-02-06 15:15:57 -0500 |
---|---|---|
committer | tilly-Q <nattilypigeonfowl@gmail.com> | 2014-04-21 12:07:59 -0400 |
commit | 2dd966b5e2c6c406d153e2d4cdf886e30198a1d3 (patch) | |
tree | 82898de69c6ec32fa3193b2864e190687f5586bb /mediagoblin/db/migrations.py | |
parent | 2edd6b0b91b38dd77837cdb21ac3a401c797dd27 (diff) | |
download | mediagoblin-2dd966b5e2c6c406d153e2d4cdf886e30198a1d3.tar.lz mediagoblin-2dd966b5e2c6c406d153e2d4cdf886e30198a1d3.tar.xz mediagoblin-2dd966b5e2c6c406d153e2d4cdf886e30198a1d3.zip |
In this commit, I added a new column which will be used for RDFa metadata of
media.
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 426080a2..a7400bf0 100644 --- a/mediagoblin/db/migrations.py +++ b/mediagoblin/db/migrations.py @@ -31,6 +31,7 @@ from mediagoblin.db.migration_tools import ( RegisterMigration, inspect_table, replace_table_hack) from mediagoblin.db.models import (MediaEntry, Collection, MediaComment, User, Privilege) +from mediagoblin.db.extratypes import JSONEncoded, MutationDict MIGRATIONS = {} @@ -720,3 +721,14 @@ def drop_MediaEntry_collected(db): media_collected.drop() db.commit() + +@RegisterMigration(20, MIGRATIONS) +def add_work_metadata_column(db): + metadata = MetaData(bind=db.bind) + + media_file = inspect_table(metadata, 'core__mediafiles') + + col = Column('work_metadata', MutationDict.as_mutable(JSONEncoded)) + col.create(media_file) + + db.commit() |