SQL Model: Forgot MediaEntry.state field
authorElrond <elrond+mediagoblin.org@samba-tng.org>
Sat, 24 Dec 2011 17:12:38 +0000 (18:12 +0100)
committerElrond <elrond+mediagoblin.org@samba-tng.org>
Wed, 28 Dec 2011 21:58:32 +0000 (22:58 +0100)
While creating the new SQL model, the "state" field of
MediaEntry was left out. Currently using a plain unicode
string for it.

Maybe should use sqlalchemy.types.Enum?

mediagoblin/db/sql/convert.py
mediagoblin/db/sql/models.py

index 6de758ede2ed630871441806a9f5e137cceaeae3..c6bed1e922772ef048c64d1a160ac26343e49cda 100644 (file)
@@ -62,7 +62,7 @@ def convert_media_entries(mk_db):
         copy_attrs(entry, new_entry,
             ('title', 'slug', 'created',
              'description', 'description_html',
-             'media_type',
+             'media_type', 'state',
              'fail_error',
              'queued_task_id',))
         copy_reference_attr(entry, new_entry, "uploader")
index 68b078a5ea4db7dd6584b06d22d7537c6c42053c..268f57159cb59ae798e4a11687846e49603056ef 100644 (file)
@@ -58,6 +58,7 @@ class MediaEntry(Base):
     description = Column(UnicodeText) # ??
     description_html = Column(UnicodeText) # ??
     media_type = Column(Unicode, nullable=False)
+    state = Column(Unicode, nullable=False) # or use sqlalchemy.types.Enum?
     
     fail_error = Column(Unicode)
     fail_metadata = Column(UnicodeText)