Add main_transcoding_progress column migration
authorvijeth-aradhya <vijthaaa@gmail.com>
Tue, 22 Aug 2017 07:52:23 +0000 (13:22 +0530)
committervijeth-aradhya <vijthaaa@gmail.com>
Tue, 22 Aug 2017 07:52:23 +0000 (13:22 +0530)
This field is required to store the progress of the default
resolution of the media. So, we now store the total progress of transcoding
the video in 'transcoding_progress' and progress of transcoding the default
resolution in 'main_transcoding_progress'.

mediagoblin/db/migrations/versions/cc3651803714_add_main_transcoding_progress_column_to_.py [new file with mode: 0644]
mediagoblin/db/models.py

diff --git a/mediagoblin/db/migrations/versions/cc3651803714_add_main_transcoding_progress_column_to_.py b/mediagoblin/db/migrations/versions/cc3651803714_add_main_transcoding_progress_column_to_.py
new file mode 100644 (file)
index 0000000..fdcde3b
--- /dev/null
@@ -0,0 +1,28 @@
+"""add main transcoding progress column to MediaEntry
+
+Revision ID: cc3651803714
+Revises: 228916769bd2
+Create Date: 2017-08-21 23:33:01.401589
+
+"""
+
+# revision identifiers, used by Alembic.
+revision = 'cc3651803714'
+down_revision = '228916769bd2'
+branch_labels = None
+depends_on = None
+
+from alembic import op
+import sqlalchemy as sa
+
+
+def upgrade():
+       """
+       Addition of main_transcoding_progress is required to save the progress of the
+       default resolution (other than the total progress of the video).
+       """
+       op.add_column('core__media_entries', sa.Column('main_transcoding_progress', sa.Float(), default=0))
+
+
+def downgrade():
+    pass
index cc06b12ff06ac92f46f27fdaa2a311e04c13030c..b2dcb6ad32068a5cbdbec368ce678ebce55b0078 100644 (file)
@@ -543,6 +543,7 @@ class MediaEntry(Base, MediaEntryMixin, CommentingMixin):
     fail_metadata = Column(JSONEncoded)
 
     transcoding_progress = Column(Float, default=0)
+    main_transcoding_progress = Column(Float, default=0)
 
     queued_media_file = Column(PathTupleWithSlashes)