Fixed migration to add foreign keys to permissions tables (tables weren't innodb + wrong data types on foreign key columns)