@Override
    public void migrate() throws Exception {
        try {
            String newLine = "";
            while ((newLine = reader.readLine()) != null) {
                if (newLine.trim().length() == 0) {
                    continue;
                } else if (newLine.startsWith(META_PREFIX)) {
                    processMetaLine(newLine);
                } else if (!newLine.startsWith(COMMENT_PREFIX)) {
                    executeCommand(newLine);
                }
            }
            if (executionStarted) {
                getMigrationExecutor().onComplete();
            }
        } catch (Exception e) {
            if (executionStarted) {
                getMigrationExecutor().onError(e);
            }
            throw e;
        } finally {
            reader.close();
        }
    }