small fix to when reindexing all metadata
fix for determining current version
working on fixing database migration
changed sql and table names to all be case sensitive for mysql.