Updates for MySQL support after previous commit

Changed all occurrences of the variable "type" to "media_type" since type is python keyword

Added MySQL specific upgrade logic in temporary code sections
Merge pull request #2 from bstrdsmkr/patch-1

Updates for MySQL support after previous commit