Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8330301
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T02:05:01+00:00 2026-06-09T02:05:01+00:00

I am facing a problem in rake db:migrate. The problem started when I created

  • 0

I am facing a problem in rake db:migrate. The problem started when I created a model using scaffold, ran the db:migrate and then deleted the model using scaffold d Posts.

Now I again created the model using scaffold g, and ran the db:migrate. As the user table already existed it gave me an error. How do I remedy this ?

murtaza@murtaza-dev:~/workspace/rails/base$ rake db:migrate
==  CreatePosts: migrating ====================================================
-- create_table(:posts) rake aborted! An error has occurred, this and all later migrations canceled:

SQLite3::SQLException: table "posts" already exists: CREATE TABLE "posts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "content" text, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 

Tasks: TOP => db:migrate (See full trace by running task with --trace) murtaza@murtaza-dev:~/workspace/rails/base$ rake db:migrate --trace
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Invoke db:load_config (first_time)
** Invoke rails_env (first_time)
** Execute rails_env
** Execute db:load_config
** Execute db:migrate
==  CreatePosts: migrating ====================================================
-- create_table(:posts) rake aborted! An error has occurred, this and all later migrations canceled:

SQLite3::SQLException: table "posts" already exists: CREATE TABLE "posts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "content" text, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)  /home/murtaza/.rvm/gems/ruby-1.9.3-p194/gems/sqlite3-1.3.6/lib/sqlite3/database.rb:91:in `initialize' /home/murtaza/.rvm/gems/ruby-1.9.3-p194/gems/sqlite3-1.3.6/lib/sqlite3/database.rb:91:in `new' /home/murtaza/.rvm/gems/ruby-1.9.3-p194/gems/sqlite3-1.3.6/lib/sqlite3/database.rb:91:in `prepare' /home/murtaza/.rvm/gems/ruby-1.9.3-p194/gems/sqlite3-1.3.6/lib/sqlite3/database.rb:134:in `execute' /home/murtaza/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.6/lib/active_record/connection_adapters/sqlite_adapter.rb:278:in `block in execute' /home/murtaza/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.6/lib/active_record/connection_adapters/abstract_adapter.rb:280:in `block in log' /home/murtaza/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.6/lib/active_support/notifications/instrumenter.rb:20:in `instrument' /home/murtaza/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.6/lib/active_record/connection_adapters/abstract_adapter.rb:275:in `log' /home/murtaza/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.6/lib/active_record/connection_adapters/sqlite_adapter.rb:278:in `execute' /home/murtaza/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.6/lib/active_record/connection_adapters/abstract/schema_statements.rb:170:in `create_table' /home/murtaza/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.6/lib/active_record/migration.rb:466:in `block in method_missing' /home/murtaza/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.6/lib/active_record/migration.rb:438:in `block in say_with_time' /home/murtaza/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/benchmark.rb:280:in `measure' /home/murtaza/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.6/lib/active_record/migration.rb:438:in `say_with_time' /home/murtaza/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.6/lib/active_record/migration.rb:458:in `method_missing' /home/murtaza/workspace/rails/base/db/migrate/20120802061742_create_posts.rb:3:in `change' /home/murtaza/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.6/lib/active_record/migration.rb:407:in `block (2 levels) in migrate' /home/murtaza/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/benchmark.rb:280:in `measure' /home/murtaza/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.6/lib/active_record/migration.rb:407:in `block in migrate' /home/murtaza/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:123:in `with_connection' /home/murtaza/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.6/lib/active_record/migration.rb:389:in `migrate' /home/murtaza/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.6/lib/active_record/migration.rb:528:in `migrate' /home/murtaza/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.6/lib/active_record/migration.rb:720:in `block (2 levels) in migrate' /home/murtaza/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.6/lib/active_record/migration.rb:775:in `call' /home/murtaza/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.6/lib/active_record/migration.rb:775:in `block in ddl_transaction' /home/murtaza/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.6/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction' /home/murtaza/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.6/lib/active_record/transactions.rb:208:in `transaction' /home/murtaza/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.6/lib/active_record/migration.rb:775:in `ddl_transaction' /home/murtaza/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.6/lib/active_record/migration.rb:719:in `block in migrate' /home/murtaza/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.6/lib/active_record/migration.rb:700:in `each' /home/murtaza/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.6/lib/active_record/migration.rb:700:in `migrate' /home/murtaza/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.6/lib/active_record/migration.rb:570:in `up' /home/murtaza/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.6/lib/active_record/migration.rb:551:in `migrate' /home/murtaza/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.6/lib/active_record/railties/databases.rake:153:in `block (2 levels) in <top (required)>' /home/murtaza/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call' /home/murtaza/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute' /home/murtaza/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each' /home/murtaza/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute' /home/murtaza/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain' /home/murtaza/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize' /home/murtaza/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain' /home/murtaza/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke' /home/murtaza/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task' /home/murtaza/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level' /home/murtaza/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each' /home/murtaza/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level' /home/murtaza/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling' /home/murtaza/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level' /home/murtaza/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run' /home/murtaza/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling' /home/murtaza/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run' /home/murtaza/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>' /home/murtaza/.rvm/gems/ruby-1.9.3-p194/bin/rake:23:in `load' /home/murtaza/.rvm/gems/ruby-1.9.3-p194/bin/rake:23:in `<main>' Tasks: TOP => db:migrate
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T02:05:03+00:00Added an answer on June 9, 2026 at 2:05 am

    Try

    rake db:drop && rake db:create && rake db:migrate && rake db:schema:dump && rake db:test:prepare
    

    or

    rake db:schema:load
    

    See:
    Purge or recreate a Ruby on Rails database

    Multiple migrations are creating the user table more than once. You can manually look through each migration and remove the create table query.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Facing problem with every fetch i want to make using EF Query model.Place here
I am facing problem with UIPanGestureRecognizer. suppose i am adding 10 button dynamicaly using
I am facing problem in getting Facebook data I am using Facebook SDK for
I'm facing problem when migrate my web app project from development server to live
I'm facing problem in showing FolderBrowserDialog instance created and called from a non-UI thread.
I am facing problem on binding jquery event on items created through another action
I am newbie in java. I am facing problem now. My purpose is to
I am facing problem for reading xml file using javascript. It works fine in
We hosted our website over Amazon EC2 but now we are facing problem in
I am using separate hbm.xml files for hibernate mappings and facing problem in defining

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.