Browse files

Only process columns that end with '_id'

  • Loading branch information...
1 parent b530f99 commit 20c0ab848e511a8fa10aff66b2c0c6c17ed35267 @melriffe melriffe committed with mjankowski Jul 22, 2010
Showing with 1 addition and 1 deletion.
  1. +1 −1 tasks/db/indexes.rake
View
2 tasks/db/indexes.rake
@@ -7,7 +7,7 @@ namespace :db do
conn.tables.each do |table|
indexed_columns = conn.indexes(table).map { |i| i.columns }.flatten
conn.columns(table).each do |column|
- if column.name.match(/_id/) && !indexed_columns.include?(column.name)
+ if column.name.match(/_id$/) && !indexed_columns.include?(column.name)
indexes[table] ||= []
indexes[table] << column.name
end

0 comments on commit 20c0ab8

Please sign in to comment.