Move the Place activity to the location field (instead of a tag)
This commit is contained in:
parent
9c12a67311
commit
3c4b9e7379
3 changed files with 49 additions and 39 deletions
|
@ -361,3 +361,18 @@ class _20191020_ManuallyApprovesFollowerSupportMigrationn(Migration):
|
|||
},
|
||||
{"$set": {"meta.follow_status": "accepted"}},
|
||||
)
|
||||
|
||||
|
||||
class _20191106_PlaceTagToLocation(Migration):
|
||||
def migrate(self) -> None:
|
||||
for data in find_activities({"activity.object.tag.type": "Place"}):
|
||||
for tag in data["activity"]["object"]["tag"]:
|
||||
if tag["type"] == "Place":
|
||||
break
|
||||
DB.activities.update_one(
|
||||
{"_id": data["_id"]},
|
||||
{
|
||||
"$pull": {"activity.object.tag": {"type": "Place"}},
|
||||
"$set": {"activity.object.location": tag},
|
||||
},
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue