lib/knj/knjdb/revision.rb in knjrbfw-0.0.44 vs lib/knj/knjdb/revision.rb in knjrbfw-0.0.45
- old
+ new
@@ -40,11 +40,10 @@
tables = db.tables.list
schema["tables"].each do |table_name, table_data|
begin
begin
- raise Knj::Errors::NotFound if !tables.key?(table_name)
table_obj = db.tables[table_name]
#Cache indexes- and column-objects to avoid constant reloading.
cols = table_obj.columns
indexes = table_obj.indexes
@@ -227,13 +226,12 @@
end
end
rows_init("db" => db, "table" => table_obj, "rows" => table_data["rows"]) if table_data and table_data["rows"]
rescue Knj::Errors::NotFound => e
- if table_data["renames"]
+ if table_data.key?("renames")
table_data["renames"].each do |table_name_rename|
begin
- raise Knj::Errors::NotFound if !tables.key?(table_name)
table_rename = db.tables[table_name_rename]
table_rename.rename(table_name)
raise Knj::Errors::Retry
rescue Knj::Errors::NotFound
next
\ No newline at end of file