Replaced raw SQL with DBMigration API where possible
CamelCase to underscored
Replaced raw SQL with DBMigration API where possible