--- /dev/null
+# Generated by Django 4.2.16 on 2026-08-28 12:48
+
+from django.db import migrations
+
+
+CREATE_VIEW = """
+CREATE VIEW emails_sharedmailbox_v AS
+SELECT
+ sm.name AS from_user,
+ u.username AS to_user
+FROM emails_sharedmailbox_users g
+JOIN auth_user u ON u.id = g.user_id
+JOIN emails_sharedmailbox sm ON sm.id = g.sharedmailbox_id;
+"""
+
+DROP_VIEW = "DROP VIEW IF EXISTS emails_sharedmailbox_v;"
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('emails', '0004_sharedmailbox'),
+ ]
+
+ operations = [
+ migrations.RunSQL(CREATE_VIEW, reverse_sql=DROP_VIEW),
+ ]