Skip to content
Browse files

Omit internal dtproperties table from SQLServer table list. Closes #2729

.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2869 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent fad2aae commit 4506a463e4af0c7b8fb7fddea1c666520d895271 @jeremy jeremy committed Nov 4, 2005
View
2 activerecord/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Omit internal dtproperties table from SQLServer table list. #2729 [rtomayko@gmail.com]
+
* Quote column names in generated SQL. #2728 [rtomayko@gmail.com]
* Correct the pure-Ruby MySQL 4.1.1 shim's version test. #2718 [Jeremy Kemper]
View
12 activerecord/lib/active_record/connection_adapters/sqlserver_adapter.rb
@@ -354,13 +354,15 @@ def drop_database(name)
def create_database(name)
execute "CREATE DATABASE #{name}"
end
-
+
def tables(name = nil)
- tables = []
- execute("SELECT table_name from information_schema.tables WHERE table_type = 'BASE TABLE'", name).each {|field| tables << field[0]}
- tables
+ execute("SELECT table_name from information_schema.tables WHERE table_type = 'BASE TABLE'", name).inject([]) do |tables, field|
+ table_name = field[0]
+ tables << table_name unless table_name == 'dtproperties'
+ tables
+ end
end
-
+
def indexes(table_name, name = nil)
indexes = []
execute("EXEC sp_helpindex #{table_name}", name).each do |index|

0 comments on commit 4506a46

Please sign in to comment.
Something went wrong with that request. Please try again.