You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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>
615
620
<p>This will:</p>
616
621
<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>
620
628
</ol>
621
629
<p>Already-applied scripts are skipped on subsequent runs.</p>
0 commit comments