prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Queries search is not working on release/7.0.x
  ### Issue Summary
  
  I try building docker image with the redash dockerfile and start by docker-compose. But queries search is not working
  
  ### Steps to Reproduce
  
  ![Untitled](https://user-images.githubusercontent.com/6704470/54521288-93d2ad80-49a5-11e9-9794-94572b6698d0.gif)
  
  Check out the queries table and find that search_vector is null.
  ![1](https://user-images.githubusercontent.com/6704470/54521423-de542a00-49a5-11e9-9f37-5b5923042973.png)
  
  ### Technical details:
  
  * Redash Version: release/7.0.x
  * Browser/OS: Chrome Mac
  * How did you install Redash: redash setup
  
  
  </issue>
  <code>
  [start of redash/cli/database.py]
  1 import time
  2 
  3 from flask.cli import AppGroup
  4 from flask_migrate import stamp
  5 from sqlalchemy.exc import DatabaseError
  6 
  7 manager = AppGroup(help="Manage the database (create/drop tables).")
  8 
  9 
  10 def _wait_for_db_connection(db):
  11     retried = False
  12     while not retried:
  13         try:
  14             db.engine.execute('SELECT 1;')
  15             return
  16         except DatabaseError:
  17             time.sleep(30)
  18 
  19         retried = True
  20 
  21 
  22 @manager.command()
  23 def create_tables():
  24     """Create the database tables."""
  25     from redash.models import db
  26 
  27     _wait_for_db_connection(db)
  28     db.create_all()
  29 
  30     # Need to mark current DB as up to date
  31     stamp()
  32 
  33 
  34 @manager.command()
  35 def drop_tables():
  36     """Drop the database tables."""
  37     from redash.models import db
  38 
  39     _wait_for_db_connection(db)
  40     db.drop_all()
  41
  [end of redash/cli/database.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/redash/cli/database.py b/redash/cli/database.py
  --- a/redash/cli/database.py
  +++ b/redash/cli/database.py
  @@ -1,5 +1,6 @@
   import time
   
  +import sqlalchemy
   from flask.cli import AppGroup
   from flask_migrate import stamp
   from sqlalchemy.exc import DatabaseError
  @@ -25,6 +26,8 @@
       from redash.models import db
   
       _wait_for_db_connection(db)
  +    # To create triggers for searchable models, we need to call configure_mappers().
  +    sqlalchemy.orm.configure_mappers()
       db.create_all()
   
       # Need to mark current DB as up to date
  
verification_info: {"golden_diff": "diff --git a/redash/cli/database.py b/redash/cli/database.py\n--- a/redash/cli/database.py\n+++ b/redash/cli/database.py\n@@ -1,5 +1,6 @@\n import time\n \n+import sqlalchemy\n from flask.cli import AppGroup\n from flask_migrate import stamp\n from sqlalchemy.exc import DatabaseError\n@@ -25,6 +26,8 @@\n     from redash.models import db\n \n     _wait_for_db_connection(db)\n+    # To create triggers for searchable models, we need to call configure_mappers().\n+    sqlalchemy.orm.configure_mappers()\n     db.create_all()\n \n     # Need to mark current DB as up to date\n", "issue": "Queries search is not working on release/7.0.x\n### Issue Summary\r\n\r\nI try building docker image with the redash dockerfile and start by docker-compose. But queries search is not working\r\n\r\n### Steps to Reproduce\r\n\r\n![Untitled](https://user-images.githubusercontent.com/6704470/54521288-93d2ad80-49a5-11e9-9794-94572b6698d0.gif)\r\n\r\nCheck out the queries table and find that search_vector is null.\r\n![1](https://user-images.githubusercontent.com/6704470/54521423-de542a00-49a5-11e9-9f37-5b5923042973.png)\r\n\r\n### Technical details:\r\n\r\n* Redash Version: release/7.0.x\r\n* Browser/OS: Chrome Mac\r\n* How did you install Redash: redash setup\r\n\n", "before_files": [{"content": "import time\n\nfrom flask.cli import AppGroup\nfrom flask_migrate import stamp\nfrom sqlalchemy.exc import DatabaseError\n\nmanager = AppGroup(help=\"Manage the database (create/drop tables).\")\n\n\ndef _wait_for_db_connection(db):\n    retried = False\n    while not retried:\n        try:\n            db.engine.execute('SELECT 1;')\n            return\n        except DatabaseError:\n            time.sleep(30)\n\n        retried = True\n\n\n@manager.command()\ndef create_tables():\n    \"\"\"Create the database tables.\"\"\"\n    from redash.models import db\n\n    _wait_for_db_connection(db)\n    db.create_all()\n\n    # Need to mark current DB as up to date\n    stamp()\n\n\n@manager.command()\ndef drop_tables():\n    \"\"\"Drop the database tables.\"\"\"\n    from redash.models import db\n\n    _wait_for_db_connection(db)\n    db.drop_all()\n", "path": "redash/cli/database.py"}]}