File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
lib/active_record/connection_adapters/sqlserver Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -188,6 +188,16 @@ def column_definitions(table_name)
188188 AND KCU.CONSTRAINT_NAME = TC.CONSTRAINT_NAME
189189 AND KCU.CONSTRAINT_CATALOG = TC.CONSTRAINT_CATALOG
190190 AND KCU.CONSTRAINT_SCHEMA = TC.CONSTRAINT_SCHEMA
191+ INNER JOIN #{ db_name_with_period } .sys.schemas AS s
192+ ON s.name = columns.TABLE_SCHEMA
193+ AND s.schema_id = s.schema_id
194+ INNER JOIN #{ db_name_with_period } .sys.objects AS o
195+ ON s.schema_id = o.schema_id
196+ INNER JOIN #{ db_name_with_period } .sys.columns AS c
197+ ON o.object_id = c.object_id
198+ AND o.is_ms_shipped = 0
199+ AND o.type = 'U'
200+ AND c.name = columns.COLUMN_NAME
191201 WHERE columns.TABLE_NAME = @0
192202 AND columns.TABLE_SCHEMA = #{ table_schema . blank? ? "schema_name()" : "@1" }
193203 ORDER BY columns.ordinal_position
You can’t perform that action at this time.
0 commit comments