Skip to content

[Updated PR#1476] Add explanation for database migration resets #1941

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 5, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ This package adds functionalities to the Eloquent model and Query builder for Mo
- [Lumen](#lumen)
- [Non-Laravel projects](#non-laravel-projects)
- [Testing](#testing)
- [Database Testing](#database-testing)
- [Configuration](#configuration)
- [Eloquent](#eloquent)
- [Extending the base model](#extending-the-base-model)
Expand Down Expand Up @@ -113,6 +114,25 @@ To run the test for this package, run:
docker-compose up
```

Database Testing
-------

To reset the database after each test, add:

```php
use Illuminate\Foundation\Testing\DatabaseMigrations;
```

Also inside each test classes, add:

```php
use DatabaseMigrations;
```

Keep in mind that these traits are not yet supported:
- `use Database Transactions;`
- `use RefreshDatabase;`

Configuration
-------------
You can use MongoDB either as the main database, either as a side database. To do so, add a new `mongodb` connection to `config/database.php`:
Expand Down