diff --git a/css/default.css b/css/default.css index a552239..33f78fe 100644 --- a/css/default.css +++ b/css/default.css @@ -21,6 +21,14 @@ h2 { font-size: 25px; } +h5.license { + margin: 9px 0 22px 0; + color: #555; + font-weight: normal; + font-size: 12px; + font-style: italic; +} + .document h1, .namespace-index h1 { font-size: 32px; margin-top: 12px; @@ -433,20 +441,28 @@ p { } .markdown p, .markdown li, .markdown dt, .markdown dd, .markdown td { - line-height: 18px; + line-height: 22px; +} + +.markdown li { + padding: 2px 0; } .markdown h2 { font-weight: normal; font-size: 25px; + margin: 30px 0 10px 0; } -#content .markdown h3 { +.markdown h3 { + font-weight: normal; font-size: 20px; + margin: 30px 0 0 0; } .markdown h4 { font-size: 15px; + margin: 22px 0 -4px 0; } .doc, .public, .namespace .index { @@ -454,28 +470,27 @@ p { overflow-x: visible; } -.markdown code, .src-link a { - background: #f6f6f6; +.markdown pre > code { + display: block; + padding: 10px; +} + +.markdown pre > code, .src-link a { border: 1px solid #e4e4e4; border-radius: 2px; } -.markdown pre, pre.deps { - background: #f4f4f4; - border: 1px solid #e0e0e0; - border-radius: 2px; - padding: 5px 10px; - margin: 15px 10px; +.markdown code:not(.hljs), .src-link a { + background: #f6f6f6; } pre.deps { display: inline-block; margin: 0 10px; -} - -.markdown pre code { - background: transparent; - border: none; + border: 1px solid #e4e4e4; + border-radius: 2px; + padding: 10px; + background-color: #f6f6f6; } .markdown hr { diff --git a/css/highlight.css b/css/highlight.css new file mode 100644 index 0000000..d0cdaa3 --- /dev/null +++ b/css/highlight.css @@ -0,0 +1,97 @@ +/* +github.com style (c) Vasily Polovnyov +*/ + +.hljs { + display: block; + overflow-x: auto; + padding: 0.5em; + color: #333; + background: #f8f8f8; +} + +.hljs-comment, +.hljs-quote { + color: #998; + font-style: italic; +} + +.hljs-keyword, +.hljs-selector-tag, +.hljs-subst { + color: #333; + font-weight: bold; +} + +.hljs-number, +.hljs-literal, +.hljs-variable, +.hljs-template-variable, +.hljs-tag .hljs-attr { + color: #008080; +} + +.hljs-string, +.hljs-doctag { + color: #d14; +} + +.hljs-title, +.hljs-section, +.hljs-selector-id { + color: #900; + font-weight: bold; +} + +.hljs-subst { + font-weight: normal; +} + +.hljs-type, +.hljs-class .hljs-title { + color: #458; + font-weight: bold; +} + +.hljs-tag, +.hljs-name, +.hljs-attribute { + color: #000080; + font-weight: normal; +} + +.hljs-regexp, +.hljs-link { + color: #009926; +} + +.hljs-symbol, +.hljs-bullet { + color: #990073; +} + +.hljs-built_in, +.hljs-builtin-name { + color: #0086b3; +} + +.hljs-meta { + color: #999; + font-weight: bold; +} + +.hljs-deletion { + background: #fdd; +} + +.hljs-addition { + background: #dfd; +} + +.hljs-emphasis { + font-style: italic; +} + +.hljs-strong { + font-weight: bold; +} diff --git a/index.html b/index.html index 216ca9a..28c096c 100644 --- a/index.html +++ b/index.html @@ -1,4 +1,4 @@ -Ragtime 0.6.0

Ragtime 0.6.0

A database-independent migration library.

Installation

To install, add the following dependency to your project or build file:

[ragtime "0.6.0"]

Namespaces

ragtime.core

Functions for applying and rolling back migrations.

ragtime.jdbc

Functions for loading SQL migrations and applying them to a SQL database.

ragtime.protocols

Public variables and functions:

ragtime.repl

Convenience functions for running in the REPL.

Public variables and functions:

ragtime.strategy

Algorithms for managing conflicts between migrations applied to a database,
-and migrations that we want to apply to the database.

Public variables and functions:

\ No newline at end of file +Ragtime 0.10.0

Ragtime 0.10.0

Released under the Eclipse Public License

A database-independent migration library.

Installation

To install, add the following dependency to your project or build file:

[dev.weavejester/ragtime "0.10.0"]

Namespaces

ragtime.core

Functions for applying and rolling back migrations.

ragtime.jdbc

Functions for loading SQL migrations and applying them to a SQL database.

Public variables and functions:

ragtime.jdbc.migrations

Public variables and functions:

ragtime.next-jdbc

Functions for loading SQL migrations and applying them to a SQL database.

Public variables and functions:

ragtime.protocols

Protocols for defining a migration and data store.

Public variables and functions:

ragtime.repl

Convenience functions for running in the REPL.

Public variables and functions:

ragtime.reporter

Functions for reporting on migrations that are applied or rolled back.

Public variables and functions:

ragtime.sql.compiler

Public variables and functions:

ragtime.strategy

Algorithms for managing conflicts between migrations applied to a database,
+and migrations that we want to apply to the database.

Public variables and functions:

\ No newline at end of file diff --git a/js/highlight.min.js b/js/highlight.min.js new file mode 100644 index 0000000..6486ffd --- /dev/null +++ b/js/highlight.min.js @@ -0,0 +1,2 @@ +/*! highlight.js v9.6.0 | BSD3 License | git.io/hljslicense */ +!function(e){var n="object"==typeof window&&window||"object"==typeof self&&self;"undefined"!=typeof exports?e(exports):n&&(n.hljs=e({}),"function"==typeof define&&define.amd&&define([],function(){return n.hljs}))}(function(e){function n(e){return e.replace(/[&<>]/gm,function(e){return I[e]})}function t(e){return e.nodeName.toLowerCase()}function r(e,n){var t=e&&e.exec(n);return t&&0===t.index}function a(e){return k.test(e)}function i(e){var n,t,r,i,o=e.className+" ";if(o+=e.parentNode?e.parentNode.className:"",t=B.exec(o))return R(t[1])?t[1]:"no-highlight";for(o=o.split(/\s+/),n=0,r=o.length;r>n;n++)if(i=o[n],a(i)||R(i))return i}function o(e,n){var t,r={};for(t in e)r[t]=e[t];if(n)for(t in n)r[t]=n[t];return r}function u(e){var n=[];return function r(e,a){for(var i=e.firstChild;i;i=i.nextSibling)3===i.nodeType?a+=i.nodeValue.length:1===i.nodeType&&(n.push({event:"start",offset:a,node:i}),a=r(i,a),t(i).match(/br|hr|img|input/)||n.push({event:"stop",offset:a,node:i}));return a}(e,0),n}function c(e,r,a){function i(){return e.length&&r.length?e[0].offset!==r[0].offset?e[0].offset"}function u(e){l+=""}function c(e){("start"===e.event?o:u)(e.node)}for(var s=0,l="",f=[];e.length||r.length;){var g=i();if(l+=n(a.substr(s,g[0].offset-s)),s=g[0].offset,g===e){f.reverse().forEach(u);do c(g.splice(0,1)[0]),g=i();while(g===e&&g.length&&g[0].offset===s);f.reverse().forEach(o)}else"start"===g[0].event?f.push(g[0].node):f.pop(),c(g.splice(0,1)[0])}return l+n(a.substr(s))}function s(e){function n(e){return e&&e.source||e}function t(t,r){return new RegExp(n(t),"m"+(e.cI?"i":"")+(r?"g":""))}function r(a,i){if(!a.compiled){if(a.compiled=!0,a.k=a.k||a.bK,a.k){var u={},c=function(n,t){e.cI&&(t=t.toLowerCase()),t.split(" ").forEach(function(e){var t=e.split("|");u[t[0]]=[n,t[1]?Number(t[1]):1]})};"string"==typeof a.k?c("keyword",a.k):E(a.k).forEach(function(e){c(e,a.k[e])}),a.k=u}a.lR=t(a.l||/\w+/,!0),i&&(a.bK&&(a.b="\\b("+a.bK.split(" ").join("|")+")\\b"),a.b||(a.b=/\B|\b/),a.bR=t(a.b),a.e||a.eW||(a.e=/\B|\b/),a.e&&(a.eR=t(a.e)),a.tE=n(a.e)||"",a.eW&&i.tE&&(a.tE+=(a.e?"|":"")+i.tE)),a.i&&(a.iR=t(a.i)),null==a.r&&(a.r=1),a.c||(a.c=[]);var s=[];a.c.forEach(function(e){e.v?e.v.forEach(function(n){s.push(o(e,n))}):s.push("self"===e?a:e)}),a.c=s,a.c.forEach(function(e){r(e,a)}),a.starts&&r(a.starts,i);var l=a.c.map(function(e){return e.bK?"\\.?("+e.b+")\\.?":e.b}).concat([a.tE,a.i]).map(n).filter(Boolean);a.t=l.length?t(l.join("|"),!0):{exec:function(){return null}}}}r(e)}function l(e,t,a,i){function o(e,n){var t,a;for(t=0,a=n.c.length;a>t;t++)if(r(n.c[t].bR,e))return n.c[t]}function u(e,n){if(r(e.eR,n)){for(;e.endsParent&&e.parent;)e=e.parent;return e}return e.eW?u(e.parent,n):void 0}function c(e,n){return!a&&r(n.iR,e)}function g(e,n){var t=N.cI?n[0].toLowerCase():n[0];return e.k.hasOwnProperty(t)&&e.k[t]}function h(e,n,t,r){var a=r?"":y.classPrefix,i='',i+n+o}function p(){var e,t,r,a;if(!E.k)return n(B);for(a="",t=0,E.lR.lastIndex=0,r=E.lR.exec(B);r;)a+=n(B.substr(t,r.index-t)),e=g(E,r),e?(M+=e[1],a+=h(e[0],n(r[0]))):a+=n(r[0]),t=E.lR.lastIndex,r=E.lR.exec(B);return a+n(B.substr(t))}function d(){var e="string"==typeof E.sL;if(e&&!x[E.sL])return n(B);var t=e?l(E.sL,B,!0,L[E.sL]):f(B,E.sL.length?E.sL:void 0);return E.r>0&&(M+=t.r),e&&(L[E.sL]=t.top),h(t.language,t.value,!1,!0)}function b(){k+=null!=E.sL?d():p(),B=""}function v(e){k+=e.cN?h(e.cN,"",!0):"",E=Object.create(e,{parent:{value:E}})}function m(e,n){if(B+=e,null==n)return b(),0;var t=o(n,E);if(t)return t.skip?B+=n:(t.eB&&(B+=n),b(),t.rB||t.eB||(B=n)),v(t,n),t.rB?0:n.length;var r=u(E,n);if(r){var a=E;a.skip?B+=n:(a.rE||a.eE||(B+=n),b(),a.eE&&(B=n));do E.cN&&(k+=C),E.skip||(M+=E.r),E=E.parent;while(E!==r.parent);return r.starts&&v(r.starts,""),a.rE?0:n.length}if(c(n,E))throw new Error('Illegal lexeme "'+n+'" for mode "'+(E.cN||"")+'"');return B+=n,n.length||1}var N=R(e);if(!N)throw new Error('Unknown language: "'+e+'"');s(N);var w,E=i||N,L={},k="";for(w=E;w!==N;w=w.parent)w.cN&&(k=h(w.cN,"",!0)+k);var B="",M=0;try{for(var I,j,O=0;;){if(E.t.lastIndex=O,I=E.t.exec(t),!I)break;j=m(t.substr(O,I.index-O),I[0]),O=I.index+j}for(m(t.substr(O)),w=E;w.parent;w=w.parent)w.cN&&(k+=C);return{r:M,value:k,language:e,top:E}}catch(T){if(T.message&&-1!==T.message.indexOf("Illegal"))return{r:0,value:n(t)};throw T}}function f(e,t){t=t||y.languages||E(x);var r={r:0,value:n(e)},a=r;return t.filter(R).forEach(function(n){var t=l(n,e,!1);t.language=n,t.r>a.r&&(a=t),t.r>r.r&&(a=r,r=t)}),a.language&&(r.second_best=a),r}function g(e){return y.tabReplace||y.useBR?e.replace(M,function(e,n){return y.useBR&&"\n"===e?"
":y.tabReplace?n.replace(/\t/g,y.tabReplace):void 0}):e}function h(e,n,t){var r=n?L[n]:t,a=[e.trim()];return e.match(/\bhljs\b/)||a.push("hljs"),-1===e.indexOf(r)&&a.push(r),a.join(" ").trim()}function p(e){var n,t,r,o,s,p=i(e);a(p)||(y.useBR?(n=document.createElementNS("http://www.w3.org/1999/xhtml","div"),n.innerHTML=e.innerHTML.replace(/\n/g,"").replace(//g,"\n")):n=e,s=n.textContent,r=p?l(p,s,!0):f(s),t=u(n),t.length&&(o=document.createElementNS("http://www.w3.org/1999/xhtml","div"),o.innerHTML=r.value,r.value=c(t,u(o),s)),r.value=g(r.value),e.innerHTML=r.value,e.className=h(e.className,p,r.language),e.result={language:r.language,re:r.r},r.second_best&&(e.second_best={language:r.second_best.language,re:r.second_best.r}))}function d(e){y=o(y,e)}function b(){if(!b.called){b.called=!0;var e=document.querySelectorAll("pre code");w.forEach.call(e,p)}}function v(){addEventListener("DOMContentLoaded",b,!1),addEventListener("load",b,!1)}function m(n,t){var r=x[n]=t(e);r.aliases&&r.aliases.forEach(function(e){L[e]=n})}function N(){return E(x)}function R(e){return e=(e||"").toLowerCase(),x[e]||x[L[e]]}var w=[],E=Object.keys,x={},L={},k=/^(no-?highlight|plain|text)$/i,B=/\blang(?:uage)?-([\w-]+)\b/i,M=/((^(<[^>]+>|\t|)+|(?:\n)))/gm,C="
",y={classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:void 0},I={"&":"&","<":"<",">":">"};return e.highlight=l,e.highlightAuto=f,e.fixMarkup=g,e.highlightBlock=p,e.configure=d,e.initHighlighting=b,e.initHighlightingOnLoad=v,e.registerLanguage=m,e.listLanguages=N,e.getLanguage=R,e.inherit=o,e.IR="[a-zA-Z]\\w*",e.UIR="[a-zA-Z_]\\w*",e.NR="\\b\\d+(\\.\\d+)?",e.CNR="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",e.BNR="\\b(0b[01]+)",e.RSR="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",e.BE={b:"\\\\[\\s\\S]",r:0},e.ASM={cN:"string",b:"'",e:"'",i:"\\n",c:[e.BE]},e.QSM={cN:"string",b:'"',e:'"',i:"\\n",c:[e.BE]},e.PWM={b:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|like)\b/},e.C=function(n,t,r){var a=e.inherit({cN:"comment",b:n,e:t,c:[]},r||{});return a.c.push(e.PWM),a.c.push({cN:"doctag",b:"(?:TODO|FIXME|NOTE|BUG|XXX):",r:0}),a},e.CLCM=e.C("//","$"),e.CBCM=e.C("/\\*","\\*/"),e.HCM=e.C("#","$"),e.NM={cN:"number",b:e.NR,r:0},e.CNM={cN:"number",b:e.CNR,r:0},e.BNM={cN:"number",b:e.BNR,r:0},e.CSSNM={cN:"number",b:e.NR+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",r:0},e.RM={cN:"regexp",b:/\//,e:/\/[gimuy]*/,i:/\n/,c:[e.BE,{b:/\[/,e:/\]/,r:0,c:[e.BE]}]},e.TM={cN:"title",b:e.IR,r:0},e.UTM={cN:"title",b:e.UIR,r:0},e.METHOD_GUARD={b:"\\.\\s*"+e.UIR,r:0},e});hljs.registerLanguage("clojure",function(e){var t={"builtin-name":"def defonce cond apply if-not if-let if not not= = < > <= >= == + / * - rem quot neg? pos? delay? symbol? keyword? true? false? integer? empty? coll? list? set? ifn? fn? associative? sequential? sorted? counted? reversible? number? decimal? class? distinct? isa? float? rational? reduced? ratio? odd? even? char? seq? vector? string? map? nil? contains? zero? instance? not-every? not-any? libspec? -> ->> .. . inc compare do dotimes mapcat take remove take-while drop letfn drop-last take-last drop-while while intern condp case reduced cycle split-at split-with repeat replicate iterate range merge zipmap declare line-seq sort comparator sort-by dorun doall nthnext nthrest partition eval doseq await await-for let agent atom send send-off release-pending-sends add-watch mapv filterv remove-watch agent-error restart-agent set-error-handler error-handler set-error-mode! error-mode shutdown-agents quote var fn loop recur throw try monitor-enter monitor-exit defmacro defn defn- macroexpand macroexpand-1 for dosync and or when when-not when-let comp juxt partial sequence memoize constantly complement identity assert peek pop doto proxy defstruct first rest cons defprotocol cast coll deftype defrecord last butlast sigs reify second ffirst fnext nfirst nnext defmulti defmethod meta with-meta ns in-ns create-ns import refer keys select-keys vals key val rseq name namespace promise into transient persistent! conj! assoc! dissoc! pop! disj! use class type num float double short byte boolean bigint biginteger bigdec print-method print-dup throw-if printf format load compile get-in update-in pr pr-on newline flush read slurp read-line subvec with-open memfn time re-find re-groups rand-int rand mod locking assert-valid-fdecl alias resolve ref deref refset swap! reset! set-validator! compare-and-set! alter-meta! reset-meta! commute get-validator alter ref-set ref-history-count ref-min-history ref-max-history ensure sync io! new next conj set! to-array future future-call into-array aset gen-class reduce map filter find empty hash-map hash-set sorted-map sorted-map-by sorted-set sorted-set-by vec vector seq flatten reverse assoc dissoc list disj get union difference intersection extend extend-type extend-protocol int nth delay count concat chunk chunk-buffer chunk-append chunk-first chunk-rest max min dec unchecked-inc-int unchecked-inc unchecked-dec-inc unchecked-dec unchecked-negate unchecked-add-int unchecked-add unchecked-subtract-int unchecked-subtract chunk-next chunk-cons chunked-seq? prn vary-meta lazy-seq spread list* str find-keyword keyword symbol gensym force rationalize"},r="a-zA-Z_\\-!.?+*=<>&#'",n="["+r+"]["+r+"0-9/;:]*",a="[-+]?\\d+(\\.\\d+)?",o={b:n,r:0},s={cN:"number",b:a,r:0},i=e.inherit(e.QSM,{i:null}),c=e.C(";","$",{r:0}),d={cN:"literal",b:/\b(true|false|nil)\b/},l={b:"[\\[\\{]",e:"[\\]\\}]"},m={cN:"comment",b:"\\^"+n},p=e.C("\\^\\{","\\}"),u={cN:"symbol",b:"[:]{1,2}"+n},f={b:"\\(",e:"\\)"},h={eW:!0,r:0},y={k:t,l:n,cN:"name",b:n,starts:h},b=[f,i,m,p,c,u,l,s,d,o];return f.c=[e.C("comment",""),y,h],h.c=b,l.c=b,{aliases:["clj"],i:/\S/,c:[f,i,m,p,c,u,l,s,d]}});hljs.registerLanguage("clojure-repl",function(e){return{c:[{cN:"meta",b:/^([\w.-]+|\s*#_)=>/,starts:{e:/$/,sL:"clojure"}}]}}); \ No newline at end of file diff --git a/ragtime.core.html b/ragtime.core.html index 13dee26..f25ae12 100644 --- a/ragtime.core.html +++ b/ragtime.core.html @@ -1,16 +1,30 @@ -ragtime.core documentation

ragtime.core

Functions for applying and rolling back migrations.
+ragtime.core documentation

ragtime.core

Functions for applying and rolling back migrations.
 

applied-migrations

(applied-migrations store index)
List all migrations in the index that are applied to the database.
 

into-index

(into-index migrations)(into-index index migrations)
Add migrations to a map, using their :id as the key.
 

migrate

(migrate store migration)
Apply a single migration to a data store.
-

migrate-all

(migrate-all store index migrations)(migrate-all store index migrations strategy)
Migrate a data store with the supplied index, migrations and
-strategy. The index matches IDs in the data store with their
-associated migrations. The strategy defines what to do if there are
-conflicts between the migrations applied to the data store, and the
-migrations that need to be applied. The default strategy is
-ragtime.strategy/raise-error.

rollback

(rollback store migration)
Rollback a migration already applied to the database.
-

rollback-last

(rollback-last store index)(rollback-last store index n)
Rollback the last n migrations from the database, using the supplied
+

migrate-all

(migrate-all store index migrations)(migrate-all store index migrations options)
Migrate a data store with the supplied index and migration sequence. The
+index matches IDs in the data store with their associated migrations. The
+migrations should be a sequential collection in the order in which they
+should be applied to the database.
+
+An additional map of options may be supplied that contains the following
+keys:
+
+:strategy - defines what to do if there are conflicts between the migrations
+            applied to the data store, and the migrations that need to be
+            applied. The default strategy is ragtime.strategy/raise-error.
+
+:reporter - a function that takes three arguments: the store, the operation
+            (:up or :down) and the migration ID. The reporter is a
+            side-effectful callback that can be used to print or report on
+            the migrations as they are applied. The default reporter is
+            ragtime.reporter/silent.

rollback

(rollback store migration)
Rollback a migration already applied to the database.
+

rollback-last

(rollback-last store index)(rollback-last store index n)(rollback-last store index n options)
Rollback the last n migrations from the database, using the supplied
 migration index. If n is not specified, only the very last migration is
-rolled back.

rollback-to

(rollback-to store index migration-id)
Rollback to a specific migration ID, using the supplied migration index.
-
\ No newline at end of file +rolled back. + +Takes an option map that may include the :reporter key. See migrate-all.

rollback-to

(rollback-to store index migration-id)(rollback-to store index migration-id options)
Rollback to a specific migration ID, using the supplied migration index.
+
+Takes an option map that may include the :reporter key. See migrate-all.
\ No newline at end of file diff --git a/ragtime.jdbc.html b/ragtime.jdbc.html index 652de3b..6f26187 100644 --- a/ragtime.jdbc.html +++ b/ragtime.jdbc.html @@ -1,13 +1,15 @@ -ragtime.jdbc documentation

ragtime.jdbc

Functions for loading SQL migrations and applying them to a SQL database.
+ragtime.jdbc documentation

ragtime.jdbc

Functions for loading SQL migrations and applying them to a SQL database.
 

load-directory

(load-directory path)
Load a collection of Ragtime migrations from a directory.
-

load-files

multimethod

Given an collection of files with the same extension, return a ordered
-collection of migrations. Dispatches on extension (e.g. ".edn"). Extend
-this multimethod to support new formats for specifying SQL migrations.

load-resources

(load-resources path)
Load a collection of Ragtime migrations from a classpath prefix.
+

load-resources

(load-resources path)
Load a collection of Ragtime migrations from a classpath prefix.
 

sql-database

(sql-database db-spec)(sql-database db-spec options)
Given a db-spec and a map of options, return a Migratable database.
 The following options are allowed:
 
 :migrations-table - the name of the table to store the applied migrations
-                    (defaults to ragtime_migrations)

sql-migration

(sql-migration migration-map)
Create a Ragtime migration from a map with a unique :id, and :up and :down
+                    (defaults to ragtime_migrations)
+
+:migrations-table-exists-sql - SQL string to check if migrations table
+                               exists. If not supplied, database metadata is
+                               used instead, which can be slow for large DBs.

sql-migration

(sql-migration migration-map)
Create a Ragtime migration from a map with a unique :id, and :up and :down
 keys that map to ordered collection of SQL strings.
\ No newline at end of file diff --git a/ragtime.jdbc.migrations.html b/ragtime.jdbc.migrations.html new file mode 100644 index 0000000..4ae4102 --- /dev/null +++ b/ragtime.jdbc.migrations.html @@ -0,0 +1,3 @@ + +ragtime.jdbc.migrations documentation

ragtime.jdbc.migrations

create-table

(create-table id table specs)
\ No newline at end of file diff --git a/ragtime.next-jdbc.html b/ragtime.next-jdbc.html new file mode 100644 index 0000000..8130c11 --- /dev/null +++ b/ragtime.next-jdbc.html @@ -0,0 +1,17 @@ + +ragtime.next-jdbc documentation

ragtime.next-jdbc

Functions for loading SQL migrations and applying them to a SQL database.
+

load-directory

(load-directory path)
Load a collection of Ragtime migrations from a directory.
+

load-resources

(load-resources path)
Load a collection of Ragtime migrations from a classpath prefix.
+

sql-database

(sql-database datasource)(sql-database datasource options)
Given a datasource and a map of options, return a Migratable database.
+The following options are allowed:
+
+:migrations-table - the name of the table to store the applied migrations
+                    (defaults to ragtime_migrations). You must include the
+                    schema name if your DB supports that and you are not
+                    using the default one (ex.: myschema.migrations)
+
+:migrations-table-exists-sql - SQL string to check if migrations table
+                               exists. If not supplied, database metadata is
+                               used instead, which can be slow for large DBs.

sql-migration

(sql-migration migration-map)
Create a Ragtime migration from a map with a unique :id, and :up and :down
+keys that map to ordered collection of SQL strings.
\ No newline at end of file diff --git a/ragtime.protocols.html b/ragtime.protocols.html index 9469fd9..00f4fdd 100644 --- a/ragtime.protocols.html +++ b/ragtime.protocols.html @@ -1,6 +1,7 @@ -ragtime.protocols documentation

ragtime.protocols

DataStore

protocol

Protocol for a data store that can be migrated.
+ragtime.protocols documentation

ragtime.protocols

Protocols for defining a migration and data store.
+

DataStore

protocol

Protocol for a data store that can be migrated.
 

members

add-migration-id

(add-migration-id store migration-id)
Add an applied migration ID to the data store.
 

applied-migration-ids

(applied-migration-ids store)
Return an ordered list of ids of all migrations applied to the data store.
 

remove-migration-id

(remove-migration-id store migration-id)
Remove a rolled-back migration ID from the data store.
diff --git a/ragtime.repl.html b/ragtime.repl.html
index 839bde3..9838229 100644
--- a/ragtime.repl.html
+++ b/ragtime.repl.html
@@ -1,8 +1,7 @@
 
-ragtime.repl documentation

ragtime.repl

Convenience functions for running in the REPL.
-

default-reporter

(default-reporter _ op id)
A reporter function that just prints the migration ID to STDOUT.
-

migrate

(migrate {:keys [datastore migrations strategy reporter], :or {reporter default-reporter, strategy strategy/raise-error}})
Migrate the datastore up to the latest migration. Expects a configuration map
+ragtime.repl documentation

ragtime.repl

Convenience functions for running in the REPL.
+

migrate

(migrate {:keys [datastore migrations strategy reporter], :or {reporter reporter/print, strategy strategy/raise-error}})
Migrate the datastore up to the latest migration. Expects a configuration map
 with the following keys:
 
   :datastore  - a DataStore instance
@@ -12,7 +11,7 @@
   :reporter   - called when a migration is being applied
                 (defaults to default-reporter)

migration-index

An atom holding a map that matches migration IDs to known migrations. This
 atom is updated automatically when the migrate or rollback functions are
-called.

rollback

(rollback config)(rollback {:keys [datastore migrations reporter], :or {reporter default-reporter}} amount-or-id)
Rollback the datastore one or more migrations. Expects a configuration map
+called.

rollback

(rollback config)(rollback {:keys [datastore migrations reporter], :or {reporter reporter/print}} amount-or-id)
Rollback the datastore one or more migrations. Expects a configuration map
 and an optional number of migrations to roll back OR a migration ID to
 rollback to. The configuration expects the following keys:
 
diff --git a/ragtime.reporter.html b/ragtime.reporter.html
new file mode 100644
index 0000000..3e2fe01
--- /dev/null
+++ b/ragtime.reporter.html
@@ -0,0 +1,6 @@
+
+ragtime.reporter documentation

ragtime.reporter

Functions for reporting on migrations that are applied or rolled back.
+

print

(print _ op id)
A reporter function that prints the migration ID to STDOUT.
+

silent

(silent _ _ _)
A reporter function that ignores the migration.
+
\ No newline at end of file diff --git a/ragtime.sql.compiler.html b/ragtime.sql.compiler.html new file mode 100644 index 0000000..3b3bcc5 --- /dev/null +++ b/ragtime.sql.compiler.html @@ -0,0 +1,18 @@ + +ragtime.sql.compiler documentation

ragtime.sql.compiler

compile

(compile migrations)
Takes an ordered collection of migrations, and compiles the migrations using
+vector syntax into SQL. This replaces the :do key with the :up and :down keys
+on each affected migration. For example:
+
+    [{:id "x" :do [[:create-table t [id "int"]]]}]
+
+Is converted into:
+
+    [{:id "x" :up ["CREATE TABLE t (id int)"] :down ["DROP TABLE t"]}]
+
+Transactions may also be supplied as raw vectors, in which case an id will be
+auto generated:
+
+    [[:create-table t [id "int"]]]
+
+This function is called automatically by ragtime.sql/load-migrations.

gen-id

multimethod

\ No newline at end of file diff --git a/ragtime.sql.html b/ragtime.sql.html new file mode 100644 index 0000000..1a9cc12 --- /dev/null +++ b/ragtime.sql.html @@ -0,0 +1,8 @@ + +ragtime.sql documentation

ragtime.sql

load-directory

(load-directory path)
Load a collection of Ragtime migrations from a directory. These can be in edn
+or SQL format.

load-file-seq

multimethod

Given an collection of files with the same extension, return a ordered
+collection of migrations. Dispatches on extension (e.g. ".edn"). Extend
+this multimethod to support new formats for specifying SQL migrations.

load-migrations

(load-migrations f)
Load one or more migrations from an edn reader source. Returns an ordered
+collection of migration maps.

load-resources

(load-resources path)
Load a collection of Ragtime migrations from a classpath prefix. These can be
+in edn or SQL format.

ToURI

protocol

members

to-uri

(to-uri x)
\ No newline at end of file diff --git a/ragtime.strategy.html b/ragtime.strategy.html index 762d942..bcffd43 100644 --- a/ragtime.strategy.html +++ b/ragtime.strategy.html @@ -1,8 +1,15 @@ -ragtime.strategy documentation

ragtime.strategy

Algorithms for managing conflicts between migrations applied to a database,
+ragtime.strategy documentation

ragtime.strategy

Algorithms for managing conflicts between migrations applied to a database,
 and migrations that we want to apply to the database.

apply-new

(apply-new applied migrations)
A strategy to apply any new migrations, irregardless of whether they come
-before migrations already applied to the database.

raise-error

(raise-error applied migrations)
A strategy that raises an error if there are any conflicts between the
+before migrations already applied to the database.

ignore-future

(ignore-future applied migrations)
A strategy that raises an error if there are any conflicts between the
+applied migrations and the defined migration list, unless the conflicts are
+just future migrations.
+
+This is useful for blue/green deployments where the new
+version of the application has applied some migrations that the old version is not
+aware of. With this strategy, the old version expects that some migrations may exists
+that it is not aware of.

raise-error

(raise-error applied migrations)
A strategy that raises an error if there are any conflicts between the
 applied migrations and the defined migration list. This is useful for
 production use.

rebase

(rebase applied migrations)
A strategy that rollbacks the database to the first conflict, then applies
 the successive migrations in order. This is useful when developing, but is