Fix all SQL files to work with modern versions of MySQL

Mostly involved minor changes, and fixing TYPE to ENGINE. Half of it was mostly
just finding all the places to edit

Signed-off-by: Michael Casadevall <mcasadevall@ubuntu.com>