We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN 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


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `redash/cli/database.py`
Content:
```
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 FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

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

{"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"}], "after_files": [{"content": "import time\n\nimport sqlalchemy\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    # 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    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"}]}