Skip to content

Commit ea9aa1d

Browse files
committed
Last commit was partial. this completes it.
1 parent 339072f commit ea9aa1d

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

lib/active_record/connection_adapters/sqlserver/schema_statements.rb

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,7 @@ def column_definitions(table_name)
175175
WHEN KCU.COLUMN_NAME IS NOT NULL AND TC.CONSTRAINT_TYPE = N'PRIMARY KEY' THEN 1
176176
ELSE NULL
177177
END AS [is_primary],
178-
CASE
179-
WHEN COLUMNPROPERTY(OBJECT_ID('#{db_name_with_period}'+columns.TABLE_SCHEMA+'.'+columns.TABLE_NAME), columns.COLUMN_NAME, 'IsIdentity') = 1 THEN 1
180-
ELSE NULL
181-
END AS [is_identity]
178+
c.is_identity AS [is_identity]
182179
FROM #{db_name_with_period}INFORMATION_SCHEMA.COLUMNS columns
183180
LEFT OUTER JOIN #{db_name_with_period}INFORMATION_SCHEMA.TABLE_CONSTRAINTS AS TC
184181
ON TC.TABLE_NAME = columns.TABLE_NAME

0 commit comments

Comments
 (0)