Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SchemaDumper] Handle edge cases for metric tables
(AKA: The "Martin H. Factor" commit) So, when doing something outside of Rails to, say, backup a metrics table before testing a migration by doing something like: > cop[y] metric_rollups_01 to xmetric_rollups_01 as a backup Then this will get picked up by the `METRIC_ROLLUP_TABLE_REGEXP`, and work though the other methods (`determine_table_parent`) and cause the following error: ** Execute db:schema:dump rake aborted! NoMethodError: undefined method `[]' for nil:NilClass manageiq-schema/lib/manageiq/schema/schema_dumper.rb:100:in `determine_table_parent' manageiq-schema/lib/manageiq/schema/schema_dumper.rb:91:in `track_miq_metric_table_inheritance' manageiq-schema/lib/manageiq/schema/schema_dumper.rb:16:in `table' This does another check to handle these cases. This means said table can't be used with the Rails models, but that should be fine since this table is definitely outside of the Rails managed tables.
- Loading branch information