     (io/copy (io/file source-path) (io/file dest-path))))
 
 
-(defn seed-copy [plugin]
+(defn seed-copy [conf plugin]
   (when-let [data-dir (io/resource (str (seed-dir plugin) "/public"))]
     (doseq [source-file (-> data-dir io/as-file file-seq rest)]
-      (copy-file source-file (str "resources/public/" (public-path source-file))))))
+      (copy-file source-file (str (:data-dir conf "resources/public") "/" (public-path source-file))))))
 
 
-(defn migratus-config [ds plugin]
+(defn migratus-config [conf plugin]
   {:store                :database
-   :db                   (jdbc-uri ds)
+   :db                   (jdbc-uri conf)
    :migration-dir        (migration-dir plugin)
    :migration-table-name schema-table})
 
 
 (defn applied-migrations
-  ([ds]
+  ([conf]
    (try
-     (map :id (jdbc/query (jdbc-uri ds) [(str "SELECT id from " schema-table " ORDER BY id ASC")]))
+     (map :id (jdbc/query (jdbc-uri conf) [(str "SELECT id from " schema-table " ORDER BY id ASC")]))
      (catch Exception e)))
 
-  ([ds plugin]
-   (let [applied (applied-migrations ds)
+  ([conf plugin]
+   (let [applied (applied-migrations conf)
         available (->> (migration-dir plugin) find-migrations keys (map str) set)]
     (filter available (map str applied)))))
 
 
-(defn run-down [ds plugin applied]
+(defn run-down [conf plugin applied]
   (doseq [id applied]
-    (migratus/down (migratus-config ds plugin) (parse-migration-id id))))
+    (migratus/down (migratus-config conf plugin) (parse-migration-id id))))
 
 
-(defn run-seed [ds plugin]
+(defn run-seed [conf plugin]
   (when-let [data-file (io/resource (str (seed-dir plugin) "/data.edn"))]
     (log/info "running seed functions for plugin" (name plugin))
-    (seed-insert ds data-file)
-    (seed-copy plugin)))
+    (seed-insert conf data-file)
+    (seed-copy conf plugin)))
 
 
-(defn run-reset [ds plugin]
-  (let [applied (reverse (applied-migrations ds plugin))]
+(defn run-reset [conf plugin]
+  (let [applied (reverse (applied-migrations conf plugin))]
     (do
       (log/info "running reset functions for plugin" (name plugin))
-      (run-down ds plugin applied)
-      (migratus/migrate (migratus-config ds plugin))
-      (run-seed ds plugin))))
+      (run-down conf plugin applied)
+      (migratus/migrate (migratus-config conf plugin))
+      (run-seed conf plugin))))
 
 
 (defn run-test-reset []
   (doseq [plugin (plugins)]
-    (run-reset (test-ds) plugin)))
+    (run-reset (test-config) plugin)))
 
 
 (defn migrate-all [config-path]
   (let [config (read-config config-path)]
     (doseq [plugin (:plugins config)]
-      (migratus/migrate (migratus-config (:datasource config) plugin)))))
+      (migratus/migrate (migratus-config config plugin)))))
 
 ;;;
 


(defn plugins [] (cons :core (:plugins (dev-config))))

(defn dev-ds [] (:datasource (dev-config)))

(defn test-ds [] (:datasource (test-config)))

(defn jdbc-uri [source]
  (str "jdbc:" (:adapter source "mysql") "://"
       (:server-name source "localhost")  "/" (:database-name source)
       "?user=" (:username source)
       (if (not-empty (:password source)) (str "&password=" (:password source)))))


(def schema-table "schema_migrations")

  (str "migrations/" (name plugin) "/seed"))


(defn seed-insert [conf data-file]
  (doseq [seed (-> data-file slurp read-string)]
    (jdbc/insert! (jdbc-uri conf) (:table seed) (:data seed))))


(defn copy-file [source-path dest-path]
