Check database version before migrating