Skip to content

Commit fe1944d

Browse files
author
Exploding Labs Bot
committed
Update site from docs source repo
1 parent e250966 commit fe1944d

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
lines changed

superstack/migrations/index.html

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,15 @@
384384
</span>
385385
</a>
386386

387+
</li>
388+
389+
<li class="md-nav__item">
390+
<a href="#suggested-file-layout" class="md-nav__link">
391+
<span class="md-ellipsis">
392+
Suggested File Layout
393+
</span>
394+
</a>
395+
387396
</li>
388397

389398
<li class="md-nav__item">
@@ -542,6 +551,15 @@
542551
</span>
543552
</a>
544553

554+
</li>
555+
556+
<li class="md-nav__item">
557+
<a href="#suggested-file-layout" class="md-nav__link">
558+
<span class="md-ellipsis">
559+
Suggested File Layout
560+
</span>
561+
</a>
562+
545563
</li>
546564

547565
<li class="md-nav__item">
@@ -641,6 +659,23 @@ <h2 id="transactions">🔁 Transactions</h2>
641659
<span class="k">REINDEX</span>
642660
<span class="k">VACUUM</span>
643661
</code></pre></div>
662+
<h2 id="suggested-file-layout">Suggested File Layout</h2>
663+
<p>SuperStack doesn't require any file names or layout, that's up to you.</p>
664+
<p>But here's one you might use while developing (pre-production):</p>
665+
<div class="highlight"><pre><span></span><code>01-extensions.sql
666+
02-create_auth_schema.sql (if using PostgREST for auth)
667+
03-create_api_schema.sql
668+
04-roles.sql
669+
05-grants.sql
670+
</code></pre></div>
671+
<p>During development, make changes and:</p>
672+
<div class="highlight"><pre><span></span><code>docker<span class="w"> </span>compose<span class="w"> </span>down<span class="w"> </span>--volumes<span class="p">;</span><span class="w"> </span>docker<span class="w"> </span>compose<span class="w"> </span>up<span class="w"> </span>-d
673+
</code></pre></div>
674+
<p>Once the app's reached production (or some other environment), you can no
675+
longer keep recreating the database from scratch. Add smaller migrations from
676+
<code>06-</code> onwards, and use <code>bin/postgres migrate</code> (that's a shortcut you can use
677+
locally, on other environments the <code>bin/postgres</code> script isn't there so use
678+
<code>docker compose exec postgres migrate</code>).</p>
644679
<h2 id="nuke-everything">🔄 Nuke Everything</h2>
645680
<p>If you want to start fresh, wipe your database and re-run all migrations from
646681
scratch:</p>

0 commit comments

Comments
 (0)