Handle some very old membership values in asyncpg migration

This commit is contained in:
Tulir Asokan
2021-12-23 17:10:31 +02:00
parent 0127bb04ae
commit 4e571e6b10
@@ -113,6 +113,7 @@ async def update_state_store(conn: Connection, scheme: str) -> None:
# The Matrix state store already has more or less the correct schema, so set the version
await conn.execute("CREATE TABLE mx_version (version INTEGER PRIMARY KEY)")
await conn.execute("INSERT INTO mx_version (version) VALUES (2)")
await conn.execute("UPDATE mx_user_profile SET membership='LEAVE' WHERE membership='LEFT'")
if scheme != "sqlite":
# Also add the membership type on postgres
await conn.execute(