Fixed migrations to use queries and charset settings