Permalink
Browse files

Raise errors when index creation fails

  • Loading branch information...
Tim Connor authored and josevalim committed Sep 17, 2010
1 parent 9401fa0 commit 55d0d57bfc72c0bdbc81ae5d95c99729f16899af
@@ -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(", ")

1 comment on commit 55d0d57

@pcreux

This comment has been minimized.

Show comment Hide comment
@pcreux

pcreux Jun 14, 2011

Contributor

I'm currently writing migrations for a Rails 3.0.0 app where indexes still fails silently. Thanks for having fixed this! :)

Contributor

pcreux commented on 55d0d57 Jun 14, 2011

I'm currently writing migrations for a Rails 3.0.0 app where indexes still fails silently. Thanks for having fixed this! :)

Please sign in to comment.