Skip to content

Commit d1e0327

Browse files
committed
Adding single database configuration instructions to readme
1 parent 4b32982 commit d1e0327

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,9 @@ You can configure Solid Errors via the Rails configuration object, under the `so
162162
* `email_to` - The email address(es) to send a notification to. See [Email notifications](#email-notifications) for more information.
163163
* `email_subject_prefix` - Prefix added to the subject line for email notifications. See [Email notifications](#email-notifications) for more information.
164164

165-
#### Database Configuration
165+
### Database Configuration
166166

167-
`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:
167+
`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:
168168

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

181+
#### Single Database Configuration
182+
183+
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:
184+
185+
1. Copy the contents of `db/errors_schema.rb` into a normal migration and delete `db/errors_schema.rb`
186+
2. Remove `config.solid_errors.connects_to` from your configuration files.
187+
3. Migrate your database.
188+
189+
You won't have multiple databases, so `database.yml` doesn't need to have the errors database configuration.
190+
181191
#### Authentication
182192

183193
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.

0 commit comments

Comments
 (0)