]> gitweb.mndrdr.org Git - arelpe.git/commitdiff
Github actions sucks, really sucks, its pernickety about database.yml, why?
authorAidan Cornelius-Bell <[email protected]>
Tue, 31 Dec 2024 21:17:02 +0000 (07:47 +1030)
committerAidan Cornelius-Bell <[email protected]>
Tue, 31 Dec 2024 21:17:02 +0000 (07:47 +1030)
config/database.yml

index 02ff4e466017dfad26879584c9da06560d0b1c82..ead71ef8b46d69514febff6df80a655b3d92eb53 100644 (file)
@@ -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