    (doseq [[table-name schema] table-name-schema-pairs]
      (when (not (table-created? db-name table-name))
        (create-table! db-name table-name schema)))
-   (load-doctopus)))
+   (load-doctopus)
+   (create-fts-document-index db-name)))


(def table-name-schema-pairs [["heads" head-schema]
                              ["tentacles" tentacle-schema]
                              ["head_tentacle_mappings" head-tentacle-schema]])

(defn- load-doctopus
  "On bootstrap, we want to create a Head, a Tentacle for Doctopus itself, and

   [:tentacle_name "varchar(50) references tentacles(name) on delete cascade"]
   ["PRIMARY KEY(head_name, tentacle_name)"]])

(def document-schema
  [[:name "varchar(50)" "PRIMARY KEY"]
   [:uri "varchar(100) NOT NULL"]
   [:body :text "NOT NULL"]
   [:search_vector "tsvector"]
   [:tentacle_name "varchar(50) references tentacles(name) on delete cascade"]
   [:created :timestamp "NOT NULL DEFAULT NOW()"]
   [:updated :timestamp "NOT NULL"]])

(defn do-sql-with-logging!
  [sql-statement db-name]
  (try (sql/db-do-commands (build-db-spec-by-name db-name) sql-statement)
