prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Django erroneously reports makemigrations is needed
  There is a problem with Django migration changes detector when running `migrate` command after setting up Django using `django,setup()`. For some reason, it is considering `mathesar.models.query.UIQuery` model to be missing. 
  
  </issue>
  <code>
  [start of mathesar/admin.py]
  1 from django.contrib import admin
  2 from django.contrib.auth.admin import UserAdmin
  3 
  4 from mathesar.models.base import Table, Schema, DataFile
  5 from mathesar.models.users import User
  6 
  7 
  8 class MathesarUserAdmin(UserAdmin):
  9     model = User
  10 
  11     fieldsets = (
  12         (None, {'fields': ('username', 'password')}),
  13         ('Personal info', {'fields': ('full_name', 'short_name', 'email',)}),
  14         ('Permissions', {
  15             'fields': ('is_active', 'is_staff', 'is_superuser', 'groups'),
  16         }),
  17         ('Important dates', {'fields': ('last_login', 'date_joined')}),
  18     )
  19 
  20 
  21 admin.site.register(Table)
  22 admin.site.register(Schema)
  23 admin.site.register(DataFile)
  24 admin.site.register(User, MathesarUserAdmin)
  25
  [end of mathesar/admin.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/mathesar/admin.py b/mathesar/admin.py
  --- a/mathesar/admin.py
  +++ b/mathesar/admin.py
  @@ -3,6 +3,7 @@
   
   from mathesar.models.base import Table, Schema, DataFile
   from mathesar.models.users import User
  +from mathesar.models.query import UIQuery
   
   
   class MathesarUserAdmin(UserAdmin):
  @@ -22,3 +23,4 @@
   admin.site.register(Schema)
   admin.site.register(DataFile)
   admin.site.register(User, MathesarUserAdmin)
  +admin.site.register(UIQuery)
  
verification_info: {"golden_diff": "diff --git a/mathesar/admin.py b/mathesar/admin.py\n--- a/mathesar/admin.py\n+++ b/mathesar/admin.py\n@@ -3,6 +3,7 @@\n \n from mathesar.models.base import Table, Schema, DataFile\n from mathesar.models.users import User\n+from mathesar.models.query import UIQuery\n \n \n class MathesarUserAdmin(UserAdmin):\n@@ -22,3 +23,4 @@\n admin.site.register(Schema)\n admin.site.register(DataFile)\n admin.site.register(User, MathesarUserAdmin)\n+admin.site.register(UIQuery)\n", "issue": "Django erroneously reports makemigrations is needed\nThere is a problem with Django migration changes detector when running `migrate` command after setting up Django using `django,setup()`. For some reason, it is considering `mathesar.models.query.UIQuery` model to be missing. \n", "before_files": [{"content": "from django.contrib import admin\nfrom django.contrib.auth.admin import UserAdmin\n\nfrom mathesar.models.base import Table, Schema, DataFile\nfrom mathesar.models.users import User\n\n\nclass MathesarUserAdmin(UserAdmin):\n    model = User\n\n    fieldsets = (\n        (None, {'fields': ('username', 'password')}),\n        ('Personal info', {'fields': ('full_name', 'short_name', 'email',)}),\n        ('Permissions', {\n            'fields': ('is_active', 'is_staff', 'is_superuser', 'groups'),\n        }),\n        ('Important dates', {'fields': ('last_login', 'date_joined')}),\n    )\n\n\nadmin.site.register(Table)\nadmin.site.register(Schema)\nadmin.site.register(DataFile)\nadmin.site.register(User, MathesarUserAdmin)\n", "path": "mathesar/admin.py"}]}