Skip to content

Commit

Permalink
Trying wih Trilogy
Browse files Browse the repository at this point in the history
  • Loading branch information
louispt1 committed Dec 11, 2024
1 parent cf45c4b commit 55827a3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 32 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ gem "rails", "~> 7.2.1"
# The original asset pipeline for Rails [https://github.com/rails/sprockets-rails]
gem "sprockets-rails"
# Use mysql as the database for Active Record
gem "mysql2", "~> 0.5.6"
gem "trilogy"
# Use the Puma web server [https://github.com/puma/puma]
gem "puma", ">= 5.0"
# Use JavaScript with ESM import maps [https://github.com/rails/importmap-rails]
Expand Down
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,6 @@ GEM
minitest (5.25.1)
msgpack (1.7.3)
multi_json (1.15.0)
mysql2 (0.5.6)
net-http (0.4.1)
uri
net-imap (0.5.0)
Expand Down Expand Up @@ -450,6 +449,7 @@ GEM
thor (1.3.2)
tilt (2.3.0)
timeout (0.4.1)
trilogy (2.9.0)
turbo-rails (2.0.11)
actionpack (>= 6.0.0)
railties (>= 6.0.0)
Expand Down Expand Up @@ -516,7 +516,6 @@ DEPENDENCIES
jwt
listen
local_time
mysql2 (~> 0.5.6)
pagy
puma (>= 5.0)
rack-cors
Expand All @@ -533,6 +532,7 @@ DEPENDENCIES
sprockets-rails
stimulus-rails
tailwindcss-rails (~> 3.0)
trilogy
turbo-rails
tzinfo-data
view_component
Expand Down
36 changes: 7 additions & 29 deletions config/database.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
# MySQL. Versions 5.5.8 and up are supported.
# Trilogy. Versions supported via the trilogy gem.
#
# Install the MySQL driver
# gem install mysql2
# Install the Trilogy driver
# gem install trilogy
#
# 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
# Ensure the Trilogy gem is defined in your Gemfile
# gem "trilogy"
#
default: &default
adapter: mysql2
adapter: trilogy
encoding: utf8mb4
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
username: root
Expand All @@ -31,26 +28,7 @@ test:
<<: *default
database: my_etm_test

# As with config/credentials.yml, you never want to store sensitive information,
# like your database password, in your source code. If your source code is
# ever seen by anyone, they now have access to your database.
#
# Instead, provide the password or a full connection URL as an environment
# variable when you boot the app. For example:
#
# DATABASE_URL="mysql2://myuser:mypass@localhost/somedatabase"
#
# If the connection URL is provided in the special DATABASE_URL environment
# variable, Rails will automatically merge its configuration values on top of
# the values provided in this file. Alternatively, you can specify a connection
# URL environment variable explicitly:
#
# production:
# url: <%= ENV["MY_APP_DATABASE_URL"] %>
#
# Read https://guides.rubyonrails.org/configuring.html#configuring-a-database
# for a full overview on how database connection configuration can be specified.
#
# For production and staging environments, use DATABASE_URL for configuration.
production:
<<: *default
url: <%= ENV['DATABASE_URL'] %>
Expand Down

0 comments on commit 55827a3

Please sign in to comment.