Fixed error with oauth using sql database

Mongo related classes are not generated when using sql as database.

Fix #701