Skip to content

Commit

Permalink
mysql2を辞める
Browse files Browse the repository at this point in the history
  • Loading branch information
jiikko committed Apr 22, 2024
1 parent 1229cc0 commit 97737bf
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 27 deletions.
3 changes: 1 addition & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby '3.2.2'

gem 'rails', "7.1.3.2"
# gem "trilogy"
gem "mysql2"
gem "trilogy"
gem 'puma'
gem 'cssbundling-rails'
gem 'importmap-rails'
Expand Down
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ GEM
msgpack (1.7.1)
multi_xml (0.6.0)
mutex_m (0.2.0)
mysql2 (0.5.6)
net-imap (0.4.10)
date
net-protocol
Expand Down Expand Up @@ -352,6 +351,7 @@ GEM
thor (1.3.1)
timecop (0.9.6)
timeout (0.4.1)
trilogy (2.8.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.4.2)
Expand Down Expand Up @@ -392,7 +392,6 @@ DEPENDENCIES
kaminari
listen
mock_redis
mysql2
newrelic_rpm
omniauth-google-oauth2
omniauth-rails_csrf_protection
Expand All @@ -412,6 +411,7 @@ DEPENDENCIES
sorcery
stimulus-rails
timecop
trilogy
uri (>= 0.12.2)

RUBY VERSION
Expand Down
2 changes: 1 addition & 1 deletion config/database.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
default: &default
adapter: mysql2
adapter: trilogy
encoding: utf8mb4
charset: utf8mb4
collation: utf8mb4_bin
Expand Down
28 changes: 7 additions & 21 deletions db/migrate/20220814053921_create_splatoon2_sketches.rb
Original file line number Diff line number Diff line change
@@ -1,27 +1,13 @@
class CreateSplatoon2Sketches < ActiveRecord::Migration[7.0]
def change
# TODO この分岐を消す
if connection && connection.adapter_name == 'Mysql2'
create_table :splatoon2_sketches do |t|
t.bigint :user_id, null: false, index: true
t.string :name, null: false
t.mediumtext :encoded_image, null: false
t.integer :binary_threshold, null: true
t.text :crop_data, null: true
create_table :splatoon2_sketches do |t|
t.bigint :user_id, null: false, index: true
t.string :name, null: false
t.mediumtext :encoded_image, null: false
t.integer :binary_threshold, null: true
t.text :crop_data, null: true

t.timestamps
end
else
raise
create_table :splatoon2_sketches do |t|
t.bigint :user_id, null: false, index: true
t.string :name, null: false
t.text :encoded_image, null: false
t.integer :binary_threshold, null: true
t.text :crop_data, null: true

t.timestamps
end
t.timestamps
end
end
end
2 changes: 1 addition & 1 deletion db/schema.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 97737bf

Please sign in to comment.