From 6695f6349b37100df0ced29ab98f56068474d01e Mon Sep 17 00:00:00 2001 From: "jorg.vr" Date: Wed, 20 Nov 2024 09:52:21 +0100 Subject: [PATCH 1/2] Replace mysql2 gem with trilogy --- Gemfile | 4 ++-- Gemfile.lock | 4 ++-- config/database.yml | 13 +------------ 3 files changed, 5 insertions(+), 16 deletions(-) diff --git a/Gemfile b/Gemfile index 687a7a463a..065a4d64b7 100644 --- a/Gemfile +++ b/Gemfile @@ -5,8 +5,8 @@ ruby '~> 3.1.2' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '~> 7.2.2' -# Use mysql as the database for Active Record -gem 'mysql2', '~> 0.5.6' +# Use trilogy to interact with mysql as the database for Active Record +gem 'trilogy', '~> 2.9.0' # Use Puma as the app server gem 'puma', '~> 6.4.3' diff --git a/Gemfile.lock b/Gemfile.lock index c8e3117b4e..bf0f894c3d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -297,7 +297,6 @@ GEM bigdecimal (~> 3.1) mustermann (3.0.3) ruby2_keywords (~> 0.0.1) - mysql2 (0.5.6) net-http (0.4.1) uri net-imap (0.5.1) @@ -531,6 +530,7 @@ GEM thor (1.3.2) tilt (2.4.0) timeout (0.4.2) + trilogy (2.9.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) unicode-display_width (2.6.0) @@ -615,7 +615,6 @@ DEPENDENCIES minitest-ci (~> 3.4.0) minitest-utils (~> 0.4.8) mocha (~> 2.5.0) - mysql2 (~> 0.5.6) nokogiri (~> 1.16.7) omniauth-google-oauth2 (~> 1.2.0) omniauth-oauth2 (~> 1.8.0) @@ -644,6 +643,7 @@ DEPENDENCIES sprockets-rails (~> 3.5.2) stackprof (~> 0.2.26) test-prof (~> 1.4.2) + trilogy (~> 2.9.0) tzinfo-data web-console (~> 4.2.1) webmock diff --git a/config/database.yml b/config/database.yml index 85bd914a3a..7b8b0241da 100644 --- a/config/database.yml +++ b/config/database.yml @@ -1,16 +1,5 @@ -# MySQL. Versions 5.0 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: -# http://dev.mysql.com/doc/refman/5.7/en/old-client.html -# default: &default - adapter: mysql2 + adapter: trilogy encoding: utf8mb4 pool: <%= ENV.fetch('RAILS_MAX_THREADS') { 5 } %> username: dodona From dd7e12e6c5c6c3e3a43644fce6c38356256a520d Mon Sep 17 00:00:00 2001 From: "jorg.vr" Date: Wed, 20 Nov 2024 09:59:41 +0100 Subject: [PATCH 2/2] Try text replacement in url of github actions --- .github/workflows/test.yml | 4 ++-- config/database.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d4b7b2ad60..17092be125 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,7 +14,7 @@ jobs: name: Test Ruby env: RAILS_ENV: "test" - TEST_DATABASE_URL: "mysql2://root:dodona@127.0.0.1:3306/dodona_test" + TEST_DATABASE_URL: "trilogy://root:dodona@127.0.0.1:3306/dodona_test" runs-on: ubuntu-latest services: mysql: @@ -82,7 +82,7 @@ jobs: env: DISABLE_SPRING: "true" RAILS_ENV: "test" - TEST_DATABASE_URL: "mysql2://root:dodona@127.0.0.1:3306/dodona_test" + TEST_DATABASE_URL: "trilogy://root:dodona@127.0.0.1:3306/dodona_test" runs-on: ubuntu-latest services: mysql: diff --git a/config/database.yml b/config/database.yml index 7b8b0241da..b55658b325 100644 --- a/config/database.yml +++ b/config/database.yml @@ -34,7 +34,7 @@ test: # On Heroku and other platform providers, you may have a full connection URL # available as an environment variable. For example: # -# DATABASE_URL="mysql2://myuser:mypass@localhost/somedatabase" +# DATABASE_URL="trilogy://myuser:mypass@localhost/somedatabase" # # You can use this database configuration with: #