Fix errors in //scouting/deploy

In I24e1687732eac36561cb8f1cfb4fb1a517895704 I added the `--clear-db`
option to the script. Turns out I didn't test it enough. The commands
work when typed on the console, but I made some errors when adding
them to the script.

The first fix is to set `shell=True`. Otherwise, the whole command
is interpreted as an executable.

The second fix is to quote the whole command passed to ssh. Otherwise,
the command doesn't get interpreted properly. Not exactly sure why.

Signed-off-by: Philipp Schrader <philipp.schrader@gmail.com>
Change-Id: If316847874ce61adeb05c230b711663bfbe6fd0e
diff --git a/scouting/deploy/deploy.py b/scouting/deploy/deploy.py
index 2f14f07..f947398 100644
--- a/scouting/deploy/deploy.py
+++ b/scouting/deploy/deploy.py
@@ -32,20 +32,22 @@
         print("Stopping the scouting app.")
         subprocess.run(
             f"ssh -tt {args.host} sudo systemctl stop scouting.service",
+            shell=True,
             # In case the scouting app isn't installed, ignore the error here.
             check=False,
             stdin=sys.stdin)
         print("Clearing the database.")
         subprocess.run(
             " ".join([
-                f"ssh -tt {args.host} sudo -u postgres psql",
+                f"ssh -tt {args.host}",
+                "\"sudo -u postgres psql",
                 # Drop all tables in the same schema.
                 "-c 'drop schema public cascade;'",
                 # Create an empty schema for the scouting app to use.
                 "-c 'create schema public;'",
                 # List all tables as a sanity check.
                 "-c '\dt'",
-                "postgres",
+                "postgres\"",
             ]),
             shell=True,
             check=True,