From: Aidan Cornelius-Bell Date: Tue, 31 Dec 2024 21:17:02 +0000 (+1030) Subject: Github actions sucks, really sucks, its pernickety about database.yml, why? X-Git-Url: https://gitweb.mndrdr.org/?a=commitdiff_plain;h=f256c31f975126ba27605e536c9c7f4ade0981e3;p=arelpe.git Github actions sucks, really sucks, its pernickety about database.yml, why? --- 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