Read more

Mysql/Mysql2 agnostic database.yml

Tobias Kraze
June 15, 2012Software engineer at makandra GmbH

If you upgrade to the mysql2 gem, you will run into the problem that the server's database.yml (which is usually not under version control) needs to change exactly on deploy.

Illustration online protection

Rails Long Term Support

Rails LTS provides security patches for old versions of Ruby on Rails (2.3, 3.2, 4.2 and 5.2)

  • Prevents you from data breaches and liability risks
  • Upgrade at your own pace
  • Works with modern Rubies
Read more Show archive.org snapshot

You can however make your database.yml work for mysql and mysql2 at the same time. Simpy do this

production:
   adapter: <%= defined?(Mysql2) ? 'mysql2' : 'mysql' %>
   #...
Posted by Tobias Kraze to makandra dev (2012-06-15 16:31)