You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lib/active_record/connection_adapters/sqlserver/schema_statements.rb
+19-3Lines changed: 19 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ def native_database_types
9
9
10
10
deftables(name=nil)
11
11
info_schema_querydo
12
-
select_values"SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE' AND TABLE_NAME <> 'dtproperties'"
12
+
select_values"SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE' AND TABLE_NAME <> 'dtproperties' AND TABLE_SCHEMA = schema_name()"
13
13
end
14
14
end
15
15
@@ -39,7 +39,7 @@ def indexes(table_name, name = nil)
execute"IF NOT EXISTS(SELECT * FROM sys.schemas WHERE name = 'test') EXEC sp_executesql N'CREATE SCHEMA test'"
112
+
execute"IF EXISTS(SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'sql_server_schema_columns' and TABLE_SCHEMA = 'test') DROP TABLE test.sql_server_schema_columns"
113
+
execute<<-SIMILIARTABLEINOTHERSCHEMA
114
+
CREATE TABLE test.sql_server_schema_columns(
115
+
id int IDENTITY NOT NULL primary key,
116
+
filed_1 int,
117
+
field_2 int,
118
+
name varchar(255),
119
+
description varchar(1000),
120
+
n_name nvarchar(255),
121
+
n_description nvarchar(1000)
122
+
)
123
+
SIMILIARTABLEINOTHERSCHEMA
124
+
execute"IF EXISTS(SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'sql_server_schema_identity' and TABLE_SCHEMA = 'test') DROP TABLE test.sql_server_schema_identity"
0 commit comments