title: How could I have a Ruby Gem generate Rails db migrations?
body: <p>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?</p>
  <p>My initial ideas were (1) to have a rake task in the Gem call the <code>rails generate migration ..</code> 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.</p>
  <p>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 <code>rails generate</code> commands.</p>
  <p>To reiterate the question: How could I have a Ruby Gem generate the require database migrations in the Rails application?</p>