aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortilly-Q <nattilypigeonfowl@gmail.com>2014-04-15 13:51:27 -0400
committertilly-Q <nattilypigeonfowl@gmail.com>2014-04-21 12:11:11 -0400
commit9f3dc83a6cec48379972b1f99f955b9525e77c32 (patch)
tree53eb7febd3de6ba808ee5fc3dba8ed8133ee999e
parentecea4847e8259125dec4617c6f11c7d7e3962925 (diff)
downloadmediagoblin-9f3dc83a6cec48379972b1f99f955b9525e77c32.tar.lz
mediagoblin-9f3dc83a6cec48379972b1f99f955b9525e77c32.tar.xz
mediagoblin-9f3dc83a6cec48379972b1f99f955b9525e77c32.zip
Moved the metadata column to MediaEntry rather than MediaFile
-rw-r--r--mediagoblin/db/migrations.py8
-rw-r--r--mediagoblin/db/models.py2
2 files changed, 5 insertions, 5 deletions
diff --git a/mediagoblin/db/migrations.py b/mediagoblin/db/migrations.py
index a7400bf0..294ab43b 100644
--- a/mediagoblin/db/migrations.py
+++ b/mediagoblin/db/migrations.py
@@ -723,12 +723,12 @@ def drop_MediaEntry_collected(db):
db.commit()
@RegisterMigration(20, MIGRATIONS)
-def add_work_metadata_column(db):
+def add_metadata_column(db):
metadata = MetaData(bind=db.bind)
- media_file = inspect_table(metadata, 'core__mediafiles')
+ media_entry = inspect_table(metadata, 'core__media_entries')
- col = Column('work_metadata', MutationDict.as_mutable(JSONEncoded))
- col.create(media_file)
+ col = Column('metadata', MutationDict.as_mutable(JSONEncoded))
+ col.create(media_entry)
db.commit()
diff --git a/mediagoblin/db/models.py b/mediagoblin/db/models.py
index ac69d040..7c0f0bf3 100644
--- a/mediagoblin/db/models.py
+++ b/mediagoblin/db/models.py
@@ -264,6 +264,7 @@ class MediaEntry(Base, MediaEntryMixin):
cascade="all, delete-orphan"
)
collections = association_proxy("collections_helper", "in_collection")
+ metadata = Column(MutationDict.as_mutable(JSONEncoded))
## TODO
# fail_error
@@ -420,7 +421,6 @@ class MediaFile(Base):
name_id = Column(SmallInteger, ForeignKey(FileKeynames.id), nullable=False)
file_path = Column(PathTupleWithSlashes)
file_metadata = Column(MutationDict.as_mutable(JSONEncoded))
- work_metadata = Column(MutationDict.as_mutable(JSONEncoded))
__table_args__ = (
PrimaryKeyConstraint('media_entry', 'name_id'),