From f256c31f975126ba27605e536c9c7f4ade0981e3 Mon Sep 17 00:00:00 2001 From: Aidan Cornelius-Bell Date: Wed, 1 Jan 2025 07:47:02 +1030 Subject: [PATCH] Github actions sucks, really sucks, its pernickety about database.yml, why? --- config/database.yml | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/config/database.yml b/config/database.yml index 02ff4e4..ead71ef 100644 --- a/config/database.yml +++ b/config/database.yml @@ -9,32 +9,38 @@ # And be sure to use new-style password hashing: # https://dev.mysql.com/doc/refman/5.7/en/password-hashing.html # +# MySQL. Versions 5.5.8 and up are supported. +# +# Install the MySQL driver +# gem install mysql2 +# +# Ensure the MySQL gem is defined in your Gemfile +# gem "mysql2" +# +# And be sure to use new-style password hashing: +# https://dev.mysql.com/doc/refman/5.7/en/password-hashing.html +# default: &default adapter: mysql2 encoding: utf8mb4 pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> username: root - password: <%= ENV.fetch("MYSQL_PASSWORD") %> - socket: <%= ENV['MYSQL_SOCKET'] %> + socket: <%= ENV.fetch("MYSQL_SOCKET") { nil } %> development: <<: *default database: arelpe_development + password: <%= ENV["MYSQL_PASSWORD"] %> -# Note: completely standalone test config, NOT inheriting from default test: - adapter: mysql2 - encoding: utf8mb4 - collation: utf8mb4_0900_ai_ci - pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> + <<: *default database: arelpe_test - username: root host: 127.0.0.1 production: <<: *default database: arelpe_production - password: <%= ENV.fetch("MYSQL_PASSWORD") %> - host: <%= ENV.fetch("MYSQL_HOST") %> - username: <%= ENV.fetch("MYSQL_USERNAME") %> + password: <%= ENV["MYSQL_PASSWORD"] %> + host: <%= ENV.fetch("MYSQL_HOST") { "localhost" } %> + username: <%= ENV.fetch("MYSQL_USERNAME") { "root" } %> socket: /run/mysqld/mysqld.sock -- 2.39.5