def add_keys(apps, schema_editor):
    """
    We can't import the Post model directly as it may be a newer
    version than this migration expects. We use the historical version.
    """
    try:
        CourseFile = apps.get_model('courses', 'CourseFile')
        for course_file in CourseFile.objects.all():
            course_file.file_obj.seconds = course_file.seconds
            course_file.file_obj.save()
    except:
        return
