title: How do I remove a model and its table in Ruby on Rails?
body: <p>I'm diving into RoR and I need to remove a model and its table, as well as update the other models that reference it.  I did a search on google and SO and the best answer I found was <a href="https://stackoverflow.com/questions/1981777/rails-remove-old-models-with-migrations">this</a>, but the answer is unclear to me.  The final consensus was to use the <code>ruby script/destroy model</code> method and then <em>"manually edit any migrations that might contain refs to these deleted models"</em>  It's this last part that I'm unclear about.  I want to delete the models for my <code>user</code> and <code>profile</code> models and tables...</p>
  
  <pre><code>class CreateUsers &lt; ActiveRecord::Migration
    def self.up
      create_table :users do |t|
          t.string :email
          t.string :password
  
        t.timestamps
      end
    end
  
    def self.down
      drop_table :users
    end
  end
  
  class CreateProfiles &lt; ActiveRecord::Migration
    def self.up
      create_table :profiles do |t|
          t.string :name
          t.integer :user_id
  
        t.timestamps
      end
    end
  
    def self.down
      drop_table :profiles
    end
  end
  </code></pre>
  
  <p>and update the <code>article</code> model and table that references them...</p>
  
  <pre><code>class CreateArticles &lt; ActiveRecord::Migration
    def self.up
      create_table :articles do |t|
          t.string :title
          t.text :body
          t.datetime :published_at
          t.string :image
  
        t.timestamps
      end
    end
  
    def self.down
      drop_table :articles
    end
  end
  
  
  
  class AddUserIdToArticles &lt; ActiveRecord::Migration
    def self.up
      add_column :articles, :user_id, :integer
    end
  
    def self.down
      remove_column :articles, :user_id
    end
  end
  </code></pre>
  
  <p>Can I just do <code>ruby script/destroy user</code> and then call the <code>self.down</code> methods in the <code>article</code> migrations?  If so, how do I call the 'self.down` methods and in what order?</p>
  
  <p>Thanks so much in advance for your help!</p>