Skip to content

Commit

Permalink
Merge pull request #68 from higher-pixels/database-config-readme
Browse files Browse the repository at this point in the history
Adding single database configuration instructions to readme
  • Loading branch information
fractaledmind authored Nov 1, 2024
2 parents 4b32982 + d1e0327 commit b75251b
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,9 @@ You can configure Solid Errors via the Rails configuration object, under the `so
* `email_to` - The email address(es) to send a notification to. See [Email notifications](#email-notifications) for more information.
* `email_subject_prefix` - Prefix added to the subject line for email notifications. See [Email notifications](#email-notifications) for more information.

#### Database Configuration
### Database Configuration

`config.solid_errors.connects_to` takes a custom database configuration hash that will be used in the abstract `SolidErrors::Record` Active Record model. This is required to use a different database than the main app. For example:
`config.solid_errors.connects_to` takes a custom database configuration hash that will be used in the abstract `SolidErrors::Record` Active Record model. This is required to use a different database than the main app ([but the primary database can also be used](#single-database-configuration)). For example:

```ruby
# Use a single separate DB for Solid Errors
Expand All @@ -178,6 +178,16 @@ or
config.solid_errors.connects_to = { database: { writing: :solid_errors_primary, reading: :solid_errors_replica } }
```

#### Single Database Configuration

Running Solid Errors in a separate database is recommended, but it's also possible to use one single database for both the app and the errors. Just follow these steps to add errors to the primary database:

1. Copy the contents of `db/errors_schema.rb` into a normal migration and delete `db/errors_schema.rb`
2. Remove `config.solid_errors.connects_to` from your configuration files.
3. Migrate your database.

You won't have multiple databases, so `database.yml` doesn't need to have the errors database configuration.

#### Authentication

Solid Errors does not restrict access out of the box. You must secure the dashboard yourself. However, it does provide basic HTTP authentication that can be used with basic authentication or Devise. All you need to do is setup a username and password.
Expand Down

0 comments on commit b75251b

Please sign in to comment.