Skip to content

Commit 027ecb3

Browse files
committed
Fix Rails 6 migrations
1 parent c43f5a9 commit 027ecb3

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

lib/active_record/connection_adapters/sqlserver/database_statements.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ def sql_for_insert(sql, pk, id_value, sequence_name, binds)
232232
exclude_output_inserted = exclude_output_inserted_table_name?(table_name, sql)
233233
if exclude_output_inserted
234234
id_sql_type = exclude_output_inserted.is_a?(TrueClass) ? 'bigint' : exclude_output_inserted
235-
<<-SQL.strip_heredoc
235+
<<~SQL.squish
236236
DECLARE @ssaIdInsertTable table (#{quoted_pk} #{id_sql_type});
237237
#{sql.dup.insert sql.index(/ (DEFAULT )?VALUES/), " OUTPUT INSERTED.#{quoted_pk} INTO @ssaIdInsertTable"}
238238
SELECT CAST(#{quoted_pk} AS #{id_sql_type}) FROM @ssaIdInsertTable

lib/active_record/connection_adapters/sqlserver/schema_creation.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def add_column_options!(sql, options)
3434
def action_sql(action, dependency)
3535
case dependency
3636
when :restrict
37-
raise ArgumentError, <<-MSG.strip_heredoc
37+
raise ArgumentError, <<~MSG.squish
3838
'#{dependency}' is not supported for :on_update or :on_delete.
3939
Supported values are: :nullify, :cascade
4040
MSG

lib/active_record/connection_adapters/sqlserver/schema_statements.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def native_database_types
77
@native_database_types ||= initialize_native_database_types.freeze
88
end
99

10-
def create_table(table_name, comment: nil, **options)
10+
def create_table(table_name, **options)
1111
res = super
1212
clear_cache!
1313
res
@@ -536,7 +536,7 @@ def views_real_column_name(table_name, column_name)
536536
end
537537

538538
def create_table_definition(*args)
539-
SQLServer::TableDefinition.new(*args)
539+
SQLServer::TableDefinition.new(self, *args)
540540
end
541541

542542
end

lib/active_record/connection_adapters/sqlserver_adapter.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ def reset!
191191
# === Abstract Adapter (Misc Support) =========================== #
192192

193193
def tables_with_referential_integrity
194-
schemas_and_tables = select_rows <<-SQL.strip_heredoc
194+
schemas_and_tables = select_rows <<~SQL.squish
195195
SELECT DISTINCT s.name, o.name
196196
FROM sys.foreign_keys i
197197
INNER JOIN sys.objects o ON i.parent_object_id = o.OBJECT_ID

0 commit comments

Comments
 (0)