Skip to content

Commit

Permalink
PD-5344: changeset runInTransaction behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
adrian-velonis1 committed Nov 13, 2024
1 parent 184ae64 commit ed9abe4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Content/concepts/changelogs/changeset.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ <h1 id="changeset-tag">Changeset</h1>
<p>A <MadCap:variable name="General.changeset" /> is the basic unit of change in <MadCap:variable name="General.Liquibase" />. You store all your <MadCap:variable name="General.changeset" />s in your <MadCap:xref href="home.html">Changelog</MadCap:xref>. Your <MadCap:variable name="General.changeset" />s contain <MadCap:xref href="../../change-types/home.html">[%=General.changetypes%]s</MadCap:xref> that specify what each change does, like creating a new table or adding a column to an existing table.</p>
<p>A <MadCap:variable name="General.changeset" /> is uniquely tagged by both the <code>author</code> and <code>id</code> <MadCap:variable name="General.Param/Attribute" />s (<code>author:id</code>), as well as the <MadCap:variable name="General.changelog" /> file path. The <code>id</code> tag is just an identifier—it doesn't direct the order that changes are run and doesn't have to be an integer. To deploy the <MadCap:variable name="General.changeset" /> with the <MadCap:xref href="../../commands/update/update.html">update</MadCap:xref> command, you must include both <code>author</code> and <code>id</code>. You can specify <MadCap:xref href="preconditions.html">Preconditions</MadCap:xref>, <MadCap:xref href="attributes/contexts.html">Contexts</MadCap:xref>, <MadCap:xref href="attributes/labels.html">Labels</MadCap:xref>, and other <MadCap:variable name="General.Param/Attribute" />s in individual <MadCap:variable name="General.changeset" />s to control exactly when they run.</p>
<p><b>It is a best practice to specify only one type of change per <MadCap:variable name="General.changeset" />.</b> Doing so avoids failed auto-commit statements that can leave the database in an unexpected state. When you deploy your changes, each <MadCap:variable name="General.changeset" /> either succeeds or fails; if it fails, you can correct it and deploy again. You can also add comments to individual <MadCap:variable name="General.changeset" />s to explain why they're important.</p>
<p>By default, <MadCap:variable name="General.Liquibase" /> runs <MadCap:variable name="General.changeset" />s as a single transaction. You can modify this behavior with the <code><MadCap:xref href="attributes/run-in-transaction.htm">runInTransaction</MadCap:xref></code>&#160;<MadCap:variable name="General.Param/Attribute" />. Once you run a <MadCap:variable name="General.changeset" />, <MadCap:variable name="General.Liquibase" /> does not re-run it unless you specify <code><MadCap:xref href="attributes/run-always.htm">runAlways</MadCap:xref></code> or <code><MadCap:xref href="attributes/runonchange.htm">runOnChange</MadCap:xref></code> for that <MadCap:variable name="General.changeset" />.</p>
<p>
<img src="../../Z_Resources/Images/intro-liquibase/liquibase-source-control.png" />
</p>
Expand Down

0 comments on commit ed9abe4

Please sign in to comment.