aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2010-06-28 00:12:15 +0200
committerXavier Noria <fxn@hashref.com>2010-06-28 00:12:15 +0200
commit4329f8133fee8e4f3e558787f67de59f0c4a4dd1 (patch)
tree346ef7340d8348e50d119ca749a16c1654c20a08 /activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb
parentc37f7d66e49ffe5ac2115cc30e5529fd1c2924a8 (diff)
parentebee77a28a7267d5f23a28ba23c1eb88a2d7d527 (diff)
downloadrails-4329f8133fee8e4f3e558787f67de59f0c4a4dd1.tar.gz
rails-4329f8133fee8e4f3e558787f67de59f0c4a4dd1.tar.bz2
rails-4329f8133fee8e4f3e558787f67de59f0c4a4dd1.zip
Merge remote branch 'rails/master'
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb')
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb b/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb
index 7d58bc2adf..7691b6a788 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb
@@ -582,6 +582,11 @@ module ActiveRecord
@base.add_column(@table_name, column_name, type, options)
end
+ # Checks to see if a column exists. See SchemaStatements#column_exists?
+ def column_exists?(column_name, type = nil, options = nil)
+ @base.column_exists?(@table_name, column_name, type, options)
+ end
+
# Adds a new index to the table. +column_name+ can be a single Symbol, or
# an Array of Symbols. See SchemaStatements#add_index
#
@@ -596,6 +601,11 @@ module ActiveRecord
@base.add_index(@table_name, column_name, options)
end
+ # Checks to see if an index exists. See SchemaStatements#index_exists?
+ def index_exists?(column_name, options = {})
+ @base.index_exists?(@table_name, column_name, options)
+ end
+
# Adds timestamps (created_at and updated_at) columns to the table. See SchemaStatements#add_timestamps
# ===== Example
# t.timestamps