Change from SQLite to PostgreSQL in a fresh Rails project

Change from SQLite to PostgreSQL in a fresh Rails project

Asked on January 7, 2019 in PostgreSQL.
Add Comment


  • 3 Answer(s)

    You can modify your database.yml to this instead of using the out of the box sqlite one:

    development:
      adapter: postgresql
      encoding: utf8
      database: project_development
      pool: 5
      username:
      password:
    test: &TEST
      adapter: postgresql
      encoding: utf8
      database: project_test
      pool: 5
      username:
      password:
    production:
      adapter: postgresql
      encoding: utf8
      database: project_production
      pool: 5
      username:
      password:
    cucumber:
      <<: *TEST
    
    Answered on January 7, 2019.
    Add Comment

    user can must include the line “gem ‘pg'” to your gemfile, ‘pg’ being the current postgres gem for Rails.

    Answered on January 7, 2019.
    Add Comment

    development:
    adapter: postgresql
    encoding: utf8
    database: project_development
    pool: 5
    username:
    password:

    test: &TEST
    adapter: postgresql
    encoding: utf8
    database: project_test
    pool: 5
    username:
    password:

    production:
    adapter: postgresql
    encoding: utf8
    database: project_production
    pool: 5
    username:
    password:

    cucumber:
    <<: *TEST

    Answered on March 5, 2019.
    Add Comment


  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.