From 97737bf01e37cc2e238895c9c52b6bf9c8f1b730 Mon Sep 17 00:00:00 2001 From: jiikko Date: Mon, 22 Apr 2024 19:44:43 +0900 Subject: [PATCH] =?UTF-8?q?mysql2=E3=82=92=E8=BE=9E=E3=82=81=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gemfile | 3 +- Gemfile.lock | 4 +-- config/database.yml | 2 +- ...0220814053921_create_splatoon2_sketches.rb | 28 +++++-------------- db/schema.rb | 2 +- 5 files changed, 12 insertions(+), 27 deletions(-) diff --git a/Gemfile b/Gemfile index 29f78c74..3069896c 100644 --- a/Gemfile +++ b/Gemfile @@ -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' diff --git a/Gemfile.lock b/Gemfile.lock index e86ad0a1..5dd6d95a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -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 @@ -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) @@ -392,7 +392,6 @@ DEPENDENCIES kaminari listen mock_redis - mysql2 newrelic_rpm omniauth-google-oauth2 omniauth-rails_csrf_protection @@ -412,6 +411,7 @@ DEPENDENCIES sorcery stimulus-rails timecop + trilogy uri (>= 0.12.2) RUBY VERSION diff --git a/config/database.yml b/config/database.yml index ccea49e7..b87564e4 100644 --- a/config/database.yml +++ b/config/database.yml @@ -1,5 +1,5 @@ default: &default - adapter: mysql2 + adapter: trilogy encoding: utf8mb4 charset: utf8mb4 collation: utf8mb4_bin diff --git a/db/migrate/20220814053921_create_splatoon2_sketches.rb b/db/migrate/20220814053921_create_splatoon2_sketches.rb index 19c5215d..064c6b66 100644 --- a/db/migrate/20220814053921_create_splatoon2_sketches.rb +++ b/db/migrate/20220814053921_create_splatoon2_sketches.rb @@ -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 diff --git a/db/schema.rb b/db/schema.rb index 3f733c83..5c546c08 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.0].define(version: 2022_08_26_075626) do +ActiveRecord::Schema[7.1].define(version: 2022_08_26_075626) do create_table "demo_devices", charset: "utf8mb4", collation: "utf8mb4_bin", force: :cascade do |t| t.bigint "device_id", null: false t.datetime "created_at", null: false