title: How to Manually Create a Migration File Rails 4
body: <p>As you will see, I'm pretty new to Rails.</p>
  
  <p>I am trying to follow section 3.3.2 in the <a href="http://guides.rubyonrails.org/association_basics.html" rel="noreferrer">RailsGuides on Active Record Associations</a> and it says there that when defining a many to many relationship, besides adding the <code>has_and_belongs_to_many</code> directive to the model, you <em>"need to explicitly create the joining table</em>".</p>
  
  <p>It then gives an example of the content of the migration file:</p>
  
  <pre><code>class CreateAssembliesPartsJoinTable &lt; ActiveRecord::Migration
    def change
      create_table :assemblies_parts, id: false do |t|
        t.integer :assembly_id
        t.integer :part_id
      end
    end
  end
  </code></pre>
  
  <p>My question is: what name should I give to that file? I see that the files generated by the <code>rails g ...</code> command are all in the <code>..db\migrate</code> folder and have a kind of timestamp at the beginning of the file. Can I use any name? I'm afraid to test and mess up the whole thing. I'm used to MS-SQL and being able to <em>see</em> the tables, add/modify columns, etc.</p>
  
  <p>Side question: there are a few files already there, from previous migrations. How does rails know which ones were already run? And what about running them afterwards when deploying to, say, Heroku?</p>