Cachet relies on a database to store the components and incidents, but by default the configuration is left with SQLite. This is great if you're not pushing the repository to Heroku, Dokku or other virtual containers as the information will be lost each time you push.
There is no administration panel for adding issues, so be sure to pick a database driver which you can manage the database with.
Laravel uses PDO for its database driver so it should be compatible with:
- SQLite
- MySQL
- Postgresql
- MSSQL
However Cachet is untested with only SQLite and MySQL.
All we're doing in this file is changing the connection properties of whichever database engine we want to use. For example, if we want to use MySQL, then we'd do this:
```php
'mysql' => array(
'driver' => 'mysql',
'host' => 'db.domain.com',
'database' => 'cachet',
'username' => 'user',
'password' => 'password',
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
),
```
Then we change the `default` value above to use the `mysql` index (which could be renamed if you wanted to) we've just changed:
Once we've decided on our database, we now need to run the migrations to create the tables. Again, by default Cachet uses SQLite and the database file can be found at `./app/database/production.sqlite`, however we will first need to create the file:
```bash
$ touch ./app/database/production.sqlite
```
If you've renamed the database above, then be sure to mimic the change here too.
In our command line we need to run the migrations, from within the root directory:
Next we add a lookup on our `HOSTS` file (if we're not serving Cachet externally). So open up `/etc/hosts` or on Windows it'll be `C:\Windows\System32\drivers\etc\hosts` and add this line:
If you're deploying into production you'll want to create an environmental variable as `ENV=production`. In the instance where the variable isn't defined, Cachet will think that it's `local`.