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