package com.github.arteam.dropwizard.testing.jdbi;

import org.skife.jdbi.v2.Handle;

class DataMigration {

    private final Handle handle;

    DataMigration(Handle handle) {
        this.handle = handle;
    }

    public int[] executeScript(String scriptLocation) {
        String correctLocation = !scriptLocation.startsWith("/") ?
                scriptLocation : scriptLocation.substring(1);
        return handle.createScript(correctLocation).execute();
    }

    public void sweepData() {
        handle.execute("TRUNCATE SCHEMA public RESTART IDENTITY AND COMMIT");
    }
}

@@ -79,16 +79,85 @@
 andle;%0A%0A
+/**%0A * A component that responsible for migrating data in the DB%0A */%0A
 class Da
@@ -269,32 +269,330 @@
  handle;%0A    %7D%0A%0A
+    /**%0A     * Execute a script a from a classpath location%0A     *%0A     * @param scriptLocation script location (without leading slash).%0A     *                       If one exists, it's trimmed%0A     * @return array of amounts of updated rows for each statement%0A     *         in the script%0A     */%0A
     public int%5B%5D
@@ -826,24 +826,165 @@
 e();%0A    %7D%0A%0A
+    /**%0A     * Sweep data from DB, but don't drop the schema.%0A     * Also restart sequences, so tests can rely on its predictability%0A     */%0A
     public v

Add documentation to DataMigration