Plugin Migrations have their own version history. Their version numbers
are kept in a table called ‘plugin_schema_info’, which has 1 row per
plugin with migrations.
The script/generate plugin_migration generates client migrations that
place themselves sequentially at the end of the client migrations. So
in your example, the newly added core_wiki migration would get copied
into the client my_custom_wiki but would be numbered as client migration
007.
The script/generate plugin_migration uses the plugin_schema_info version
number associated with core_wiki to see how far your client has already
been migrated and then copies the un-executed migrations to the client.
Actually it doesn’t copy them, it puts a placeholder migration that just
calls the migration on the plugin class, like:
class CoreWikiToVersion7 < ActiveRecord::Migration
def self.up
Rails.plugins[“core_wiki”].migrate(7)
end
def self.down
Rails.plugins[“core_wiki”].migrate(6)
end
end
However, I do believe that if you have copied migrations (such as this)
to the client previously, but not executed them yet, and run
script/generate plugin_migrations again you will get extra copies. I
haven’t verified this though.
Trevor Rowe