When setting ActiveRecord::Base.table_name_prefix or
table_name_suffix, Rails will dump all tables found in the database
(except schema_migrations). This is a little dangerous when you do
ie. rake db:reset. IMHO, the convention should be to dump only
tables with the set prefix and suffix.
Of course, there is ActiveRecord::SchemaDumper.ignore_tables,
but it lets you only define a blacklist, which is cumbersome on
prefixes. A prefix like 'abc' would need
ActiveRecord::SchemaDumper.ignore_tables = [ /^(?!abc)/ ]
which is advanced regex magic and maybe too complicated for
beginners.
Therefore I propose adding
ActiveRecord::SchemaDumper.dump_only_with_prefix and -suffix, where
you can turn off the new default behaviour.
This also fixes a small bug, where the table name
'schema_migrations' is hard coded instead of being used through
ActiveRecord::Migrator.schema_migrations_table_name.