Skip to content

Commit d969e0d

Browse files
Merge pull request #1 from wpolicarpo/fix-schema-dumper
Fix SchemaDumper usage
2 parents aa45eae + 111d8df commit d969e0d

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
@@ -265,6 +265,10 @@ def change_column_null(table_name, column_name, allow_null, default = nil)
265265
do_execute sql
266266
end
267267

268+
def create_schema_dumper(options)
269+
SQLServer::SchemaDumper.create(self, options)
270+
end
271+
268272
private
269273

270274
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
@@ -35,7 +35,6 @@ class SQLServerAdapter < AbstractAdapter
3535
SQLServer::Quoting,
3636
SQLServer::DatabaseStatements,
3737
SQLServer::Showplan,
38-
SQLServer::SchemaDumper,
3938
SQLServer::SchemaStatements,
4039
SQLServer::DatabaseLimits,
4140
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)