aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Connor <tim@wasabi.local>2010-09-17 15:04:27 +1200
committerJosé Valim <jose.valim@gmail.com>2010-09-18 20:49:28 +0200
commit55d0d57bfc72c0bdbc81ae5d95c99729f16899af (patch)
tree5fcfdefbc101166fdc2c11c08d799fc4d0c01dd7
parent9401fa0b9c89f51e3ec0f7aaeee7404b4a14ada8 (diff)
downloadrails-55d0d57bfc72c0bdbc81ae5d95c99729f16899af.tar.gz
rails-55d0d57bfc72c0bdbc81ae5d95c99729f16899af.tar.bz2
rails-55d0d57bfc72c0bdbc81ae5d95c99729f16899af.zip
Raise errors when index creation fails
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb6
1 files changed, 2 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
index 0245e63294..63d76472fa 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
@@ -340,12 +340,10 @@ module ActiveRecord
end
if index_name.length > index_name_length
- @logger.warn("Index name '#{index_name}' on table '#{table_name}' is too long; the limit is #{index_name_length} characters. Skipping.")
- return
+ raise ArgumentError, "Index name '#{index_name}' on table '#{table_name}' is too long; the limit is #{index_name_length} characters"
end
if index_name_exists?(table_name, index_name, false)
- @logger.warn("Index name '#{index_name}' on table '#{table_name}' already exists. Skipping.")
- return
+ raise ArgumentError, "Index name '#{index_name}' on table '#{table_name}' already exists"
end
quoted_column_names = quoted_columns_for_index(column_names, options).join(", ")