1
- # 📜 Migrations
1
+ # Build your App
2
+
3
+ ## Project Structure
4
+
5
+ ```
6
+ 📁 bin/ → Helper scripts (e.g. wrappers for CLI tools)
7
+ 📁 caddy/ → Custom Caddy configuration and certificates
8
+ 📁 docs/ → Markdown files for SuperStack documentation
9
+ 📁 postgres/ → SQL migrations and configuration of the postgres container
10
+ 📄 compose.yaml → Main Docker Compose config
11
+ 📄 compose.override.yaml → Optional local overrides (development only)
12
+ 📄 example.env → Example environment variables — copy to `.env`
13
+ 📄 LICENSE → License file (MIT)
14
+ 📄 logo.png → SuperStack logo for README/docs
15
+ 📄 mkdocs.yml → MkDocs configuration for documentation site
16
+ 📄 README.md → Overview and quick start for the repository
17
+ ```
18
+
19
+ ## 📜 Migrations
2
20
3
21
SuperStack includes a simple built-in system for managing database schema
4
22
migrations.
5
23
6
- ## ✍️ Writing Migrations
24
+ ### ✍️ Writing Migrations
7
25
8
26
Place your migration scripts in:
9
27
@@ -18,7 +36,7 @@ Each file should be:
18
36
- Written in plain SQL
19
37
- But can include environment variables.
20
38
21
- ## ▶️ Applying Migrations
39
+ ### ▶️ Applying Migrations
22
40
23
41
When the Postgres container starts with no existing data, SuperStack will
24
42
automatically run migrations once.
@@ -41,18 +59,7 @@ Already-applied scripts are skipped on subsequent runs.
41
59
42
60
> 💡 ` bin/postgres ` is short for ` docker compose exec postgres `
43
61
44
- ## 🔄 Resetting
45
-
46
- If you want to start fresh:
47
-
48
- ``` sh
49
- docker compose down --volumes
50
- docker compose up -d
51
- ```
52
-
53
- This will wipe your database and re-run all migrations from scratch.
54
-
55
- ## 🔁 Transactions
62
+ ### 🔁 Transactions
56
63
57
64
Use ` BEGIN; ` and ` COMMIT; ` to wrap migration files when all included
58
65
statements are transactional. This ensures that all changes are applied
@@ -101,3 +108,13 @@ ALTER SYSTEM
101
108
DISCARD ALL
102
109
LOAD
103
110
```
111
+
112
+ ### 🔄 Nuke Everything
113
+
114
+ If you want to start fresh, wipe your database and re-run all migrations from
115
+ scratch:
116
+
117
+ ``` sh
118
+ docker compose down --volumes
119
+ docker compose up -d
120
+ ```
0 commit comments