migration fixed to work with databases other than sqlite