Skip to content

Commit 75c0000

Browse files
committed
Improve suggested file layout section
1 parent 01e4087 commit 75c0000

File tree

1 file changed

+24
-8
lines changed

1 file changed

+24
-8
lines changed

docs/migrations.md

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,11 @@ VACUUM
8989

9090
## Suggested File Layout
9191

92-
SuperStack doesn't require any file names or layout, that's up to you.
92+
SuperStack doesn’t enforce any particular migration file names or layout —
93+
you’re free to organise them however you like.
9394

94-
But here's one you might use while developing (pre-production):
95+
Here’s a simple structure you might adopt during development (before
96+
production):
9597

9698
```
9799
01-extensions.sql
@@ -101,17 +103,31 @@ But here's one you might use while developing (pre-production):
101103
05-grants.sql
102104
```
103105

104-
During development, make changes and:
106+
While developing, you can reset and rebuild the database from scratch as often
107+
as needed:
105108

106109
```sh
107110
docker compose down --volumes; docker compose up -d
108111
```
109112

110-
Once the app's reached production (or some other environment), you can no
111-
longer keep recreating the database from scratch. Add smaller migrations from
112-
`06-` onwards, and use `bin/postgres migrate` (that's a shortcut you can use
113-
locally, on other environments the `bin/postgres` script isn't there so use
114-
`docker compose exec postgres migrate`).
113+
Once you’ve deployed to production (or another persistent environment), avoid
114+
recreating the database. Instead:
115+
116+
- Add new migrations starting from `06-...` onwards.
117+
- Apply them with:
118+
119+
```sh
120+
bin/postgres migrate
121+
```
122+
123+
In other environments where `bin/postgres` isn't available:
124+
125+
```sh
126+
docker compose exec postgres migrate
127+
```
128+
129+
This approach keeps early development simple while providing a clear, ordered
130+
history once the database must be preserved.
115131

116132
## 🔄 Nuke Everything
117133

0 commit comments

Comments
 (0)