|
384 | 384 | </span> |
385 | 385 | </a> |
386 | 386 |
|
| 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 | + |
387 | 396 | </li> |
388 | 397 |
|
389 | 398 | <li class="md-nav__item"> |
|
542 | 551 | </span> |
543 | 552 | </a> |
544 | 553 |
|
| 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 | + |
545 | 563 | </li> |
546 | 564 |
|
547 | 565 | <li class="md-nav__item"> |
@@ -641,6 +659,23 @@ <h2 id="transactions">🔁 Transactions</h2> |
641 | 659 | <span class="k">REINDEX</span> |
642 | 660 | <span class="k">VACUUM</span> |
643 | 661 | </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> |
644 | 679 | <h2 id="nuke-everything">🔄 Nuke Everything</h2> |
645 | 680 | <p>If you want to start fresh, wipe your database and re-run all migrations from |
646 | 681 | scratch:</p> |
|
0 commit comments