You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`--step [n]` For `migrate`: put each file in its own batch; for `rollback`: number of steps
@@ -37,10 +45,12 @@ Options
37
45
-`--drop-views` For `fresh`: also drop database views
38
46
39
47
Environment
48
+
40
49
- Reads `.env` automatically from the repo root.
41
50
- Uses the same env vars as the app: `DB_HOST`, `DB_PORT`, `DB_USERNAME`, `DB_PASSWORD`, `DB_DATABASE`, `DB_SOCKET` (optional), `APP_ENV`/`NODE_ENV`.
42
51
43
52
Examples
53
+
44
54
- Run migrations: `./bin/altus migrate`
45
55
- Show status: `./bin/altus migrate:status`
46
56
- Roll back last batch: `./bin/altus migrate:rollback`
@@ -58,7 +68,6 @@ Developer & testing
58
68
- The CLI module (`src/cli/index.ts`) exports its command helpers so tests can call commands like `cmdUpOne` and `cmdDownOneOrRollback` directly. The module guards its `main()` call with `if (require.main === module)` to avoid starting when imported in tests.
59
69
- The repository's integration tests already mock `mysql2/promise` and include a test that exercises the CLI helpers; run them with `npm run test:integration`.
60
70
61
-
62
71
Seed files and directory layout
63
72
64
73
Place seed SQL files under the `migrations/seeds/` directory. Seed files are executed after migrations when `--seed` is provided and are run in natural sort order (so prefix filenames with numbers to control ordering).
@@ -98,4 +107,3 @@ Notes:
98
107
99
108
- Seeds are meant for bootstrapping local/dev instances. Avoid running production-sensitive seeds in production environments.
100
109
- If `--pretend` is used, seeds will be printed but not executed.
0 commit comments