2020-02-08 18:46:27 +01:00
|
|
|
from django.db import migrations
|
|
|
|
|
|
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
|
|
|
|
dependencies = [
|
2021-02-12 08:20:45 +01:00
|
|
|
("zerver", "0266_userpresence_realm"),
|
2020-02-08 18:46:27 +01:00
|
|
|
]
|
|
|
|
|
|
|
|
operations = [
|
|
|
|
migrations.RunSQL(
|
|
|
|
"""
|
|
|
|
UPDATE zerver_userpresence
|
|
|
|
SET realm_id = zerver_userprofile.realm_id
|
|
|
|
FROM zerver_userprofile
|
|
|
|
WHERE zerver_userprofile.id = zerver_userpresence.user_profile_id;
|
|
|
|
""",
|
2021-02-12 08:20:45 +01:00
|
|
|
reverse_sql="UPDATE zerver_userpresence SET realm_id = NULL",
|
2021-02-12 08:19:30 +01:00
|
|
|
elidable=True,
|
|
|
|
),
|
2020-02-08 18:46:27 +01:00
|
|
|
]
|