check schema_migrations for latest version and only apply new migrations
implemented query to schema_migration to get the latest version