lib/lhm/table.rb in lhm-1.0.0.rc.1 vs lib/lhm/table.rb in lhm-1.0.0.rc2
- old
+ new
@@ -22,10 +22,11 @@
def destination_name
"lhmn_#{ @name }"
end
def idx_name(cols)
- "index_#{ @name }_on_" + [*cols].join("_and_")
+ column_part = Array(cols).map { |c| c.to_s.sub(/\(.*/, "") }.join("_and_")
+ "index_#{ @name }_on_#{ column_part }"
end
def self.parse(table_name, connection)
sql = "show create table `#{ table_name }`"
ddl = connection.execute(sql).fetch_row.last