Friday, 28 July 2017

Homebrew postgres

> Hi me. Remember when you used to do all your development on a Linux machine? Wasn't that nice and easy?

> Well, no, but at least tools were consistent with the server.

> Ok, good point. But you're using postgres installed through homebrew now aren't you?

> Yes...?

> So how do you create a database now?

> Oh, well you since it runs as your user you can just do:
bundle exec rake db:create

With this in your config/database.yml:
default: &default
  adapter: postgresql
  encoding: unicode
  # For details on connection pooling, see Rails configuration guide
  pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>

  <<: *default
  database: mydb_development

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
  <<: *default
  database: mydb_test
> That's remarkably easy.

> Mac!

> Traitor...