title: Need help migrating database from development to test using Rails
body: <p>Similar questions has been asked a lot. But, I think my situation is a bit different. I pulled  a db from Heroku (I use sqlite3 in prod) to my local machine (uses PostgreSQL ). The prod db didn't have any data at that time. </p>
  
  <p>After that time I haven't done any db migrations to test. Now I have a couple of fields in my dev db. However, when I go to test console to see what I have (referring a User table) User.count returns 0, but returns 2 users in dev. </p>
  
  <p>So I did rake <code>db:migrate RAILS_ENV=test</code> there was neither an error message nor a success message. I thought it was success and checked the test db if it has those 2 users and still nothing. Then I tried <code>bundle exec rake db:test:prepare</code>. This was the output</p>
  
  <pre><code>**You have 4 pending migrations:
  
    20120415210441 CreateUsers
  
    20120418064930 AddIndexToUsersEmail
  
    20120419034627 AddPasswordDigestToUsers
  
    20120504031144 AddRememberTokenToUsers
  
  Run `rake db:migrate` to update your database then try again.**
  </code></pre>
  
  <p>What is the solution?</p>
  
  <p><strong>EDIT:</strong>
  FYI: I am using windows
  I also run <strong>rake db:migrate</strong>  and I got this error.</p>
  
  <pre><code>$ rake db:migrate
  ==  CreateUsers: migrating ====================================================
  -- create_table(:users)
  rake aborted!
  An error has occurred, this and all later migrations canceled:
  
  SQLite3::SQLException: table "users" already exists: CREATE TABLE "users" ("id"
  INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "email" varcha
  (255), "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
  
  Tasks: TOP =&gt; db:migrate
  (See full trace by running task with --trace)
  </code></pre>