我尝试使用相同模型(comment.rb)作为我之前尝试安装的gem之一来实现。我已经尝试过rake db:rollback和rake db:rollback VERSION =回到我不应该进行任何迁移或任何名为' comment'的表,但是sqlite3一直在告诉我有一个带有该名称的表格,它无法前进。
rake db:migrate:status
Status Migration ID Migration Name
--------------------------------------------------
up 20140616150625 Devise create users
up 20140616151746 Create hacks
up 20140616155718 Acts as taggable on migration.acts as taggable on engine
up 20140616155719 Add missing unique indices.acts as taggable on engine
up 20140616155720 Add taggings counter cache to tags.acts as taggable on engine
up 20140617185601 Add picture to hacks
up 20140617190705 Add attachment image to hacks
up 20140617194434 Add name to users
up 20140617194509 Create identities
up 20140618125514 Add confirmable to devise
up 20140619150148 Create comments
up 20140619162204 The comments change user.the comments engine
down 20140619162205 The comments create comments.the comments engine
down 20140619162206 The comments change commentable.the comments engine
down 20140619163035 Drop comments
问题是 - 我不确定这是否称为机架跟踪?
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:
SQLite3::SQLException: table "comments" already exists: CREATE TABLE "comments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "holder_id" integer, "commentable_id" integer, "commentable_type" varchar(255), "commentable_url" varchar(255), "commentable_title" varchar(255), "commentable_state" varchar(255), "anchor" varchar(255), "title" varchar(255), "contacts" varchar(255), "raw_content" text, "content" text, "view_token" varchar(255), "state" varchar(255) DEFAULT 'draft', "ip" varchar(255) DEFAULT 'undefined', "referer" varchar(255) DEFAULT 'undefined', "user_agent" varchar(255) DEFAULT 'undefined', "tolerance_time" integer, "spam" boolean DEFAULT 'f', "parent_id" integer, "lft" integer, "rgt" integer, "depth" integer DEFAULT 0, "created_at" datetime, "updated_at" datetime) /Users/javier/.rvm/gems/ruby-2.1.2/gems/sqlite3-1.3.9/lib/sqlite3/database.rb:91:in `initialize'
我试图通过访问sqlite3来删除同一个表,但是我无法访问这些表。有什么建议吗?
答案 0 :(得分:0)