diff --git a/swh/storage/cassandra/model.py b/swh/storage/cassandra/model.py --- a/swh/storage/cassandra/model.py +++ b/swh/storage/cassandra/model.py @@ -196,6 +196,7 @@ origin: str visit: int date: datetime.datetime + type: Optional[str] status: str metadata: str snapshot: bytes diff --git a/swh/storage/cassandra/schema.py b/swh/storage/cassandra/schema.py --- a/swh/storage/cassandra/schema.py +++ b/swh/storage/cassandra/schema.py @@ -171,6 +171,7 @@ origin text, visit bigint, date timestamp, + type text, status ascii, metadata text, snapshot blob, diff --git a/swh/storage/cassandra/storage.py b/swh/storage/cassandra/storage.py --- a/swh/storage/cassandra/storage.py +++ b/swh/storage/cassandra/storage.py @@ -929,6 +929,8 @@ "origin": visit["origin"], # but keep the date of the creation of the origin visit "date": visit["date"], + # if the type is still not set on visit_status, the type of visit is used + "type": visit_status.type or visit["type"], } def _origin_visit_get_latest_status(self, visit: OriginVisit) -> OriginVisitStatus: