title: Create a rails 5 plugin that need migrations
body: <p>I want to create a rails 5+ gem that must create a migration as it would have to use a model and save/access data in DB.</p>
  
  <p>My gem has some simple classes I stored in <code>lib/</code> but it must use some that should access DB and this is what I don't know how to do.</p>
  
  <ul>
  <li><code>Language</code> should update itself in a DB</li>
  <li><code>Languages</code> should list all existing Languages and create a new <code>Language</code> </li>
  </ul>
  
  <p>Basically in a rails app, I whould create the migrations and models, but I couldn't find tutorials about how to do that, and the rails <a href="http://guides.rubyonrails.org/v5.0/plugins.html" rel="nofollow noreferrer">doc</a> did not help me. </p>
  
  <p>Any help is appreciated.</p>