Skip to content

Commit a02e8d2

Browse files
committed
[mysql] core adapter compat - missing initialize_schema_migrations_table and helpers
1 parent 6a989e4 commit a02e8d2

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

lib/arjdbc/mysql/adapter.rb

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,26 @@ def limited_update_conditions(where_sql, quoted_table_name, quoted_primary_key)
151151
where_sql
152152
end
153153

154+
def initialize_schema_migrations_table
155+
if @config[:encoding] == 'utf8mb4'
156+
ActiveRecord::SchemaMigration.create_table(191)
157+
else
158+
ActiveRecord::SchemaMigration.create_table
159+
end
160+
end if ::ActiveRecord::VERSION::MAJOR > 3
161+
162+
# HELPER METHODS ===========================================
163+
164+
# @private Only for Rails core compatibility.
165+
def new_column(field, default, type, null, collation, extra = '')
166+
Column.new(field, default, type, null, collation, strict_mode?, extra)
167+
end
168+
169+
# @private Only for Rails core compatibility.
170+
def error_number(exception)
171+
exception.error_code if exception.respond_to?(:error_code)
172+
end
173+
154174
# QUOTING ==================================================
155175

156176
# @override

0 commit comments

Comments
 (0)