lib/ridgepole/diff.rb in ridgepole-0.7.0.beta19 vs lib/ridgepole/diff.rb in ridgepole-0.7.0.beta20
- old
+ new
@@ -9,10 +9,11 @@
to = (to || {}).deep_dup
if @options[:reverse]
from, to = to, from
end
+ check_table_existence(to)
delta = {}
relation_info = {}
scan_table_rename(from, to, delta)
@@ -524,8 +525,15 @@
%*s: #{parent_column_info_str}
%*s: #{child_column_info_str}
EOS
end
end
+ end
+ end
+
+ def check_table_existence(definition)
+ return unless @options[:tables]
+ @options[:tables].each do |table_name|
+ @logger.warn "[WARNING] '#{table_name}' definition is not found" unless definition.has_key?(table_name)
end
end
end