【发布时间】:2015-11-24 14:39:06
【问题描述】:
我不小心创建了一个我不需要的迁移,因此我删除了该文件,并在我尝试运行 rake db:migrate 时创建了一个新的迁移,我不断收到此错误。我是使用 SQlite3 gem 和 Ruby on Rails 4
StandardError: An error has occurred, this and all later migrations canceled:
SQLite3::SQLException: table "categories" already exists: CREATE TABLE "categories" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "category_name" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NO
T NULL) D:/muse/db/migrate/20150830113519_create_categories.rb:3:in `change'
D:in `migrate'
ActiveRecord::StatementInvalid: SQLite3::SQLException: table "categories" already exists: CREATE TABLE "categories" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "category_name" varchar, "created_at" datetime NO
T NULL, "updated_at" datetime NOT NULL)
D:/muse/db/migrate/20150830113519_create_categories.rb:3:in `change'
D:in `migrate'
SQLite3::SQLException: table "categories" already exists
D:/muse/db/migrate/20150830113519_create_categories.rb:3:in `change'
D:in `migrate'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
【问题讨论】:
标签: ruby-on-rails-4 sqlite dbmigrate