Stratus supports MySQL, PostgreSQL, and SQLite. The default connection is MySQL. SQLite is a zero-configuration option suitable for local development and testing. MySQL or PostgreSQL are recommended for production.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/AlexanderDamont1/Stratus/llms.txt
Use this file to discover all available pages before exploring further.
Choosing a database
- MySQL (default)
- PostgreSQL
- SQLite
Create a MySQL database, then add the connection details to Then run migrations:
.env:Running migrations
Migrations create and update the database schema. Run them after configuring your database connection:Database tables
The default migrations create the following tables:| Table | Migration file | Purpose |
|---|---|---|
users | 0001_01_01_000000 | User accounts and authentication data. |
password_reset_tokens | 0001_01_01_000000 | Tokens for the password reset flow. |
sessions | 0001_01_01_000000 | Database-backed session storage. |
cache | 0001_01_01_000001 | Key-value cache store. |
cache_locks | 0001_01_01_000001 | Distributed cache lock management. |
jobs | 0001_01_01_000002 | Pending queue jobs. |
job_batches | 0001_01_01_000002 | Metadata for batched queue jobs. |
failed_jobs | 0001_01_01_000002 | Jobs that failed after all retry attempts. |
Resetting the database
To reset the database during development:Local development with Laravel Sail
Laravel Sail provides a Docker-based local environment with MySQL (or PostgreSQL) and other services configured out of the box. It is included as a dev dependency.Update .env for Sail
Sail sets the database host to the service name defined in
docker-compose.yml. Update .env:Advanced options
Connecting to an existing database
Connecting to an existing database
If you have an existing Stratus database (for example, when deploying to a new server), set the correct credentials in Laravel will only run migrations that have not been recorded in the
.env and run:migrations table, leaving existing data untouched.Changing the default database connection
Changing the default database connection
DB_CONNECTION sets the default connection. The full set of connection options for each driver is defined in config/database.php. You can define multiple connections there and reference them explicitly in model definitions or query builder calls.SQLite in-memory database for testing
SQLite in-memory database for testing
For fast test runs, configure Tests that use
phpunit.xml to use an in-memory SQLite database:RefreshDatabase or DatabaseMigrations will run against the in-memory database and leave no files on disk.