fix some entites anotations, add some tests to upgrade.php