diff --git a/swh/lister/gitea/lister.py b/swh/lister/gitea/lister.py --- a/swh/lister/gitea/lister.py +++ b/swh/lister/gitea/lister.py @@ -35,7 +35,7 @@ def get_model_from_repo(self, repo: Dict[str, Any]) -> Dict[str, Any]: return { "instance": self.instance, - "uid": repo["id"], + "uid": f"{self.instance}/{id}", "name": repo["name"], "full_name": repo["full_name"], "html_url": repo["html_url"], @@ -43,9 +43,6 @@ "origin_type": "git", } - def uid(self, id: str) -> str: - return f"{self.instance}/{id}" - def get_next_target_from_response(self, response: Response) -> Optional[int]: """Determine the next page identifier. diff --git a/swh/lister/gitea/models.py b/swh/lister/gitea/models.py --- a/swh/lister/gitea/models.py +++ b/swh/lister/gitea/models.py @@ -2,7 +2,7 @@ # License: GNU General Public License version 3, or any later version # See top-level LICENSE file for more information -from sqlalchemy import Column, Integer, String +from sqlalchemy import Column, String from ..core.models import ModelBase @@ -14,5 +14,5 @@ __tablename__ = "gitea_repo" - uid = Column(Integer, primary_key=True) + uid = Column(String, primary_key=True) instance = Column(String, index=True)