replace raw SQL with dynamic migrations and classes"