Database Scenarios

By default, Adapt creates databases with random-looking names.

These are based on the name you originally specified, as well as a checksum of the "scenario" being used. A scenario represents the things that make up the database. That is, the way it's built and populated.

This way, if you're using different seeders for different tests (for example), the resulting databases can co-exist. This allows for each to be re-used straight away, without interfering with the other.

Likewise, when parallel testing, a separate database is created for each process.

To define the scenario, Adapt creates a checksum based on the database building-blocks. These are the things the database can be built from. It then includes the settings used to build this particular database.

If you call your database "testing", you will see databases with names like "testing_17bd3c_d266ab43ac75".


You don't need to create or remove these databases yourself (although you can remove them if you want to). Adapt will create and manage them itself.

For the best performance, you'll probably want to leave this setting on. However, you can turn it off by updating Adapt's scenarios config setting. Then Adapt will simply use the database name you specified.

⚙️ See configuration
# .env.testing



// config/code_distortion.adapt.php

return ['scenarios' => env('ADAPT_SCENARIOS', true), // or false];



Turning this off will mean that thrashing may occur. This happens when tests need the database to be built in different ways. This causes the database to be rebuilt each time. Separate databases will still be created for parallel tests, however.