I want to create a Ruby Gem to integrate specific functionality into my Rails app or any other Rails app that could use this functionality. The functionality will require its own database tables. How could I have a Ruby Gem generate the require database migrations in the Rails application?
My initial ideas were (1) to have a rake task in the Gem call the rails generate migration ..
commands required for the migrations or (2) to have pre-written migration files which a rake task in the Gem just copies from the Gem into the Rails migrations folder.
I feel like with idea (1) I would be less reliant on a specific version of the migration syntax but I am not sure if it is possible to create more complex schemas using the rails generate
commands.
To reiterate the question: How could I have a Ruby Gem generate the require database migrations in the Rails application?