def METHOD_NAME():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column(
        "internalmessage_readreceipt",
        sa.Column(
            "rcpt_id",
            sa.INTEGER(),
            autoincrement=False,
            nullable=False,
            server_default="0",
        ),
    )
    op.create_foreign_key(
        "internalmessage_readreceipt_rcpt_id_fkey",
        "internalmessage_readreceipt",
        "usergroup",
        ["rcpt_id"],
        ["id"],
    )
    connection = op.get_bind()
    results = connection.execute(
        sa.select(
            [
                t_user.c.id,
                t_usergroup.c.id,
                t_internalmessage_readreceipt.c.message_id,
            ]
        ).select_from(
            sa.join(
                sa.join(
                    t_user,
                    t_internalmessage_readreceipt,
                    t_user.c.id == t_internalmessage_readreceipt.c.user_id,
                ),
                t_usergroup,
                t_usergroup.c.name == t_user.c.name,
            )
        )
    ).fetchall()
    for user_id, ug_id, im_id in results:
        connection.execute(
            t_internalmessage_readreceipt.update()
            .where(
                (t_internalmessage_readreceipt.c.user_id == user_id)
                & (t_internalmessage_readreceipt.c.message_id == im_id)
            )
            .values(rcpt_id=ug_id)
        )
    op.execute(
        "ALTER TABLE internalmessage_readreceipt DROP CONSTRAINT internalmessage_readreceipt_pkey CASCADE"
    )
    op.alter_column(
        "internalmessage_readreceipt",
        "user_id",
        existing_type=sa.INTEGER(),
        nullable=True,
    )
    op.create_primary_key(
        "internalmessage_readreceipt_pkey",
        "internalmessage_readreceipt",
        ["message_id", "rcpt_id"],
    )
    # ### end Alembic commands ###