# How to setup multiple postgresql databases?

**URL:** <https://discuss.circleci.com/t/how-to-setup-multiple-postgresql-databases/9574>\
**Category:** Databases\
**Tags:** rails, ruby, rspec, postgresql\
**Created:** [January 13, 2017, 1:04pm UTC](https://discuss.circleci.com/t/how-to-setup-multiple-postgresql-databases/9574 "2017-01-13T13:04:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![MatUrbanski](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/maturbanski/32/15206_2.png) [@MatUrbanski](https://discuss.circleci.com/u/MatUrbanski)\
**Post date:** [January 13, 2017, 1:04pm UTC](https://discuss.circleci.com/t/how-to-setup-multiple-postgresql-databases/9574/1 "2017-01-13T13:04:53Z")

</div>

I have Ruby on Rails project which is connected to two databases. To make make my tests to pass I need to have two databases created. My circle.yml file looks like that:

```auto
dependencies:
  pre:
    - bash deploy/circle-dependencies.sh

machine:
  timezone:
    America/Los_Angeles

database:
  override:
    - mv config/database.ci.yml config/database.yml
    - bundle exec rake db:create db:structure:load --trace
    - createdb dashboard_test
    - psql dashboard_test < db/dashboard_test.sql

```

I see that steps that are responsible for creating and filling `dashboard_test` database are passing. But when I run my specs then following error appears:

```auto
ActiveRecord::AdapterNotSpecified: 'dashboard_test' database is not configured. Available: ["test"]

```

How can I fix that?

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/circleci/original/3X/5/1/511608acda8e85906e15909b57bd0a46c1dbe291.png) [@system](https://discuss.circleci.com/u/system)\
**Post date:** [June 18, 2018, 11:41am UTC](https://discuss.circleci.com/t/how-to-setup-multiple-postgresql-databases/9574/2 "2018-06-18T11:41:47Z")

</div>


