Skip to content

Commit 111d8df

Browse files
committed
Fix SchemaDumper usage
1 parent ed8b170 commit 111d8df

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

lib/active_record/connection_adapters/sqlserver/schema_dumper.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module ActiveRecord
22
module ConnectionAdapters
33
module SQLServer
4-
module SchemaDumper
4+
class SchemaDumper < ConnectionAdapters::SchemaDumper
55

66
SQLSEVER_NO_LIMIT_TYPES = [
77
'text',
@@ -24,7 +24,7 @@ def schema_limit(column)
2424

2525
def schema_collation(column)
2626
return unless column.collation
27-
column.collation if column.collation != collation
27+
column.collation if column.collation != @connection.collation
2828
end
2929

3030
def default_primary_key?(column)

lib/active_record/connection_adapters/sqlserver/schema_statements.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,10 @@ def change_column_null(table_name, column_name, allow_null, default = nil)
254254
do_execute sql
255255
end
256256

257+
def create_schema_dumper(options)
258+
SQLServer::SchemaDumper.create(self, options)
259+
end
260+
257261
private
258262

259263
def data_source_sql(name = nil, type: nil)

lib/active_record/connection_adapters/sqlserver_adapter.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ class SQLServerAdapter < AbstractAdapter
3434
SQLServer::Quoting,
3535
SQLServer::DatabaseStatements,
3636
SQLServer::Showplan,
37-
SQLServer::SchemaDumper,
3837
SQLServer::SchemaStatements,
3938
SQLServer::DatabaseLimits,
4039
SQLServer::DatabaseTasks

lib/active_record/tasks/sqlserver_database_tasks.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def purge
5151
def structure_dump(filename, extra_flags)
5252
command = [
5353
"defncopy-ttds",
54-
"-S #{Shellwords.escape(configuration['host'])}",
54+
"-S #{Shellwords.escape(configuration['host'])}:#{Shellwords.escape(configuration['port'])}",
5555
"-D #{Shellwords.escape(configuration['database'])}",
5656
"-U #{Shellwords.escape(configuration['username'])}",
5757
"-P #{Shellwords.escape(configuration['password'])}",

0 commit comments

Comments
 (0)