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
Allow run migrations without truncating (#24) (#25)
* Allow run migrations without truncating (#24)
* Allow run migrations without truncating
* Truncate all connections by default
* Update Documentation
* Require migration plugin version ^3.1
Co-authored-by: Raúl Arellano <[email protected]>
Copy file name to clipboardExpand all lines: README.md
+35-10Lines changed: 35 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ With the CakePHP Test Migrator, the schema of both default and test DB are handl
20
20
21
21
The package proposes a tool to run your [migrations](https://book.cakephp.org/migrations/3/en/index.html) once prior to the tests. In order to do so,
22
22
you may place the following in your `tests/bootstrap.php`:
23
-
```$xslt
23
+
```php
24
24
\CakephpTestMigrator\Migrator::migrate();
25
25
```
26
26
This command will ensure that your migrations are well run and keeps the test DB(s) up to date. Since tables are truncated but never dropped by the present package's fixture manager, migrations will be run strictly when needed, namely only after a new migration was created by the developer.
@@ -30,23 +30,38 @@ The `Migrator`approach presents the following advantages:
30
30
* it eases the maintenance of your tests, since regular and test DBs are managed the same way,
31
31
* it indirectly tests your migrations.
32
32
33
-
You may pass `true` as the second argument for a verbose output on the console.
33
+
You may pass `true` as the second argument for a verbose output on the console.
34
+
35
+
### Options
36
+
37
+
| name | type | default | description |
38
+
| ---- | ---- | ------- | ----------- |
39
+
| verbose |*bool*|`false`| Print info about migrations done |
40
+
| truncate |*bool*|`true`| Truncate all tables after migrations are done. You can call `truncate()` manually |
41
+
42
+
You can pass a boolean as options, it will be used as `verbose`
0 commit comments