Skip to content

Commit 118b5cf

Browse files
author
Exploding Labs Bot
committed
Update site from docs source repo
1 parent aeda678 commit 118b5cf

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

superstack/migrations/index.html

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -612,11 +612,19 @@ <h2 id="applying-migrations">▶️ Applying Migrations</h2>
612612
<p>To apply your migrations, run:</p>
613613
<div class="highlight"><pre><span></span><code>bin/postgres<span class="w"> </span>migrate
614614
</code></pre></div>
615+
<p>This command will:
616+
Apply new migrations – runs any migration files (in filename order) that haven’t been applied yet.
617+
Record applied migrations – logs each successfully applied migration in a .applied_migrations file so it won’t run again.
618+
Persist migration history with your database – the .applied_migrations file lives inside the postgres_data Docker volume alongside the database files.
619+
If the postgres_data volume is deleted or recreated, both the database and the migration history are reset, so migrations will run again from scratch.</p>
615620
<p>This will:</p>
616621
<ol>
617-
<li>Run any migration files that haven’t been applied yet (in filename order)</li>
618-
<li>Record each successfully applied file in <code>.applied_migrations</code> (this
619-
file lives in the postgres data volume)</li>
622+
<li><strong>Apply new migrations,</strong> in filename order.</li>
623+
<li><strong>Record applied migrations</strong> in a file named <code>.applied_migrations</code>. This
624+
plain-text file keeps a record of successfully applied migrations so they
625+
aren't applied again next time. It lives in the same volume as the database
626+
files, so when that volume is removed or recreated, the
627+
<code>.applied_migrations</code> file goes with it and you start over.</li>
620628
</ol>
621629
<p>Already-applied scripts are skipped on subsequent runs.</p>
622630
<blockquote>
@@ -639,9 +647,9 @@ <h2 id="applying-migrations">▶️ Applying Migrations</h2>
639647
<span class="k">commit</span><span class="p">;</span>
640648
</code></pre></div>
641649
<h2 id="transactions">🔁 Transactions</h2>
642-
<p>Use <code>begin;</code> and <code>commit;</code> to wrap statements in a transaction. This
643-
ensures that all changes are applied atomically. Any statements outside of
644-
transactions will be auto-committed.</p>
650+
<p>Use <code>begin;</code> and <code>commit;</code> to wrap statements in a transaction. This ensures
651+
that all changes are applied atomically. Any statements outside of transactions
652+
will be auto-committed.</p>
645653
<p>Avoid wrapping non-transactional operations in a transaction — these will
646654
cause errors if used inside <code>begin ... commit</code>. Examples of
647655
non-transactional statements include:</p>

0 commit comments

Comments
 (0)