diff --git a/CHANGELOG.md b/CHANGELOG.md index 223ed7c2..9060464f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ + +# 1.0.0.rc4 (January 29, 2012) + +* added '-- lhm' to the end of statements for more visibility + # 1.0.0.rc3 (January 19, 2012) * Speedup migrations for tables with large minimum id diff --git a/lib/lhm/sql_helper.rb b/lib/lhm/sql_helper.rb index 29dbcc25..3ca389e9 100644 --- a/lib/lhm/sql_helper.rb +++ b/lib/lhm/sql_helper.rb @@ -21,14 +21,16 @@ def table?(table_name) end def sql(statements) - [statements].flatten.each { |statement| connection.execute(statement) } + [statements].flatten.each do |statement| + connection.execute(tagged(statement)) + end rescue ActiveRecord::StatementInvalid, Mysql::Error => e error e.message end def update(statements) [statements].flatten.inject(0) do |memo, statement| - memo += connection.update(statement) + memo += connection.update(tagged(statement)) end rescue ActiveRecord::StatementInvalid, Mysql::Error => e error e.message @@ -36,6 +38,10 @@ def update(statements) private + def tagged(statement) + statement + " -- lhm" + end + def column_definition(cols) Array(cols).map do |column| column.to_s.match(/`?([^\(]+)`?(\([^\)]+\))?/).captures diff --git a/lib/lhm/version.rb b/lib/lhm/version.rb index 3e4a9c9b..065aaabe 100644 --- a/lib/lhm/version.rb +++ b/lib/lhm/version.rb @@ -2,5 +2,5 @@ # Schmidt module Lhm - VERSION = "1.0.0.rc3" + VERSION = "1.0.0.rc4" end