Skip to content

Commit 76b82d2

Browse files
committed
Remove adapter column from rails 8.1. Update configy.yml.erb to expose
a host:port combo for connections to the db in tests
1 parent 6b38704 commit 76b82d2

File tree

3 files changed

+7
-22
lines changed

3 files changed

+7
-22
lines changed

config.yml.erb

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
username: <%= ENV['PERCONA_DB_USER'] || 'root' %>
2-
password: <%= ENV['PERCONA_DB_PASSWORD'] || '' %>
3-
database: <%= ENV['PERCONA_DB_NAME'] || 'departure_test' %>
4-
hostname: <%= ENV['PERCONA_DB_HOST'] || 'localhost' %>
5-
socket: <%= ENV['PERCONA_DB_SOCKET'] || '' %>
2+
password: <%= ENV['PERCONA_DB_PASSWORD'] || '' %>
3+
database: <%= ENV['PERCONA_DB_NAME'] || 'departure_test' %>
4+
host: <%= ENV['PERCONA_DB_HOST'] || 'localhost' %>
5+
port: <%= ENV['PERCONA_DB_PORT'] || 3306 %>
6+
<% if ENV['PERCONA_DB_SOCKET'] && !ENV['PERCONA_DB_SOCKET'].empty? %>
7+
socket: <%= ENV['PERCONA_DB_SOCKET'] %>
8+
<% end %>

lib/active_record/connection_adapters/rails_8_1_mysql2_adapter.rb

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,6 @@ module ConnectionAdapters
99
class Rails81Mysql2Adapter < ActiveRecord::ConnectionAdapters::Mysql2Adapter
1010
TYPE_MAP = Type::TypeMap.new.tap { |m| initialize_type_map(m) } if defined?(initialize_type_map)
1111

12-
class Column < ActiveRecord::ConnectionAdapters::MySQL::Column
13-
def adapter
14-
Rails81Mysql2Adapter
15-
end
16-
end
17-
1812
# https://github.com/departurerb/departure/commit/f178ca26cd3befa1c68301d3b57810f8cdcff9eb
1913
# For `DROP FOREIGN KEY constraint_name` with pt-online-schema-change requires specifying `_constraint_name`
2014
# rather than the real constraint_name due to to a limitation in MySQL
@@ -33,8 +27,6 @@ def visit_DropForeignKey(name) # rubocop:disable Naming/MethodName
3327
end
3428
end
3529

36-
extend Forwardable
37-
3830
include ForAlterStatements unless method_defined?(:change_column_for_alter)
3931

4032
ADAPTER_NAME = 'Percona'.freeze

lib/active_record/connection_adapters/rails_8_1_trilogy_adapter.rb

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,6 @@
77
module ActiveRecord
88
module ConnectionAdapters
99
class Rails81TrilogyAdapter < ActiveRecord::ConnectionAdapters::TrilogyAdapter
10-
TYPE_MAP = Type::TypeMap.new.tap { |m| initialize_type_map(m) } if defined?(initialize_type_map)
11-
12-
class Column < ActiveRecord::ConnectionAdapters::MySQL::Column
13-
def adapter
14-
Rails81TrilogyAdapter
15-
end
16-
end
17-
1810
# https://github.com/departurerb/departure/commit/f178ca26cd3befa1c68301d3b57810f8cdcff9eb
1911
# For `DROP FOREIGN KEY constraint_name` with pt-online-schema-change requires specifying `_constraint_name`
2012
# rather than the real constraint_name due to to a limitation in MySQL
@@ -33,8 +25,6 @@ def visit_DropForeignKey(name) # rubocop:disable Naming/MethodName
3325
end
3426
end
3527

36-
extend Forwardable
37-
3828
include ForAlterStatements unless method_defined?(:change_column_for_alter)
3929

4030
ADAPTER_NAME = 'Percona'.freeze

0 commit comments

Comments
 (0)