Skip to content

Migrate db to postgress #10

Description

@XaoGao

After #7 #9. We want to use postgress for our project

  1. Add in gem to Gemfile pg last version https://rubygems.org/gems/pg
  2. Run
bundle install
  1. Change database.yml file to
    default: &default
    adapter: postgresql
    encoding: unicode
    pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
    port: <%= ENV.fetch("DATABASE_PORT") %>
    host: <%= ENV.fetch("DATABASE_HOST") %>
    user: <%= ENV.fetch("POSTGRES_USER") %>
    password: <%= ENV.fetch("POSTGRES_PASSWORD") %>

development:
<<: *default
database: rubywork_ru_development

test:
<<: *default
database: rubywork_ru_test

production:
<<: *default
database: rubywork_ru_production

  1. Run
rails db:create && rails db:migrate
  1. Launch project, open browser localhoat:3000 and check DB have users table

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions