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