Fix a bug with the db table upgrade being skipped