Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace mysql2 gem with trilogy #5951

Merged
merged 2 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
name: Test Ruby
env:
RAILS_ENV: "test"
TEST_DATABASE_URL: "mysql2://root:[email protected]:3306/dodona_test"
TEST_DATABASE_URL: "trilogy://root:[email protected]:3306/dodona_test"
runs-on: ubuntu-latest
services:
mysql:
Expand Down Expand Up @@ -82,7 +82,7 @@ jobs:
env:
DISABLE_SPRING: "true"
RAILS_ENV: "test"
TEST_DATABASE_URL: "mysql2://root:[email protected]:3306/dodona_test"
TEST_DATABASE_URL: "trilogy://root:[email protected]:3306/dodona_test"
runs-on: ubuntu-latest
services:
mysql:
Expand Down
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
15 changes: 2 additions & 13 deletions config/database.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -45,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:
#
Expand Down