Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Raise errors when index creation fails

Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information...
commit 2f618bf7dada80dc57f5b263e7216d65230116a1 1 parent f90a298
Tim Connor authored josevalim committed
View
6 activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
@@ -340,12 +340,10 @@ def add_index(table_name, column_name, options = {})
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(", ")
Please sign in to comment.
Something went wrong with that request. Please try again.