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
220
321SuperStack includes a simple built-in system for managing database schema
422migrations.
523
6- ## βοΈ Writing Migrations
24+ ### βοΈ Writing Migrations
725
826Place your migration scripts in:
927
@@ -18,7 +36,7 @@ Each file should be:
1836- Written in plain SQL
1937- But can include environment variables.
2038
21- ## βΆοΈ Applying Migrations
39+ ### βΆοΈ Applying Migrations
2240
2341When the Postgres container starts with no existing data, SuperStack will
2442automatically run migrations once.
@@ -41,18 +59,7 @@ Already-applied scripts are skipped on subsequent runs.
4159
4260> π‘ ` bin/postgres ` is short for ` docker compose exec postgres `
4361
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
5663
5764Use ` BEGIN; ` and ` COMMIT; ` to wrap migration files when all included
5865statements are transactional. This ensures that all changes are applied
@@ -101,3 +108,13 @@ ALTER SYSTEM
101108DISCARD ALL
102109LOAD
103110```
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