когда я запускаю эту команду bin/грабли БД: мигрироватьОшибка бен/граблей дб: мигрировать
Я получаю эту ошибку
== 20151020021106 CreateTodoItems: migrating ================================== -- create_table(:todo_items) rake aborted! StandardError: An error has occurred, this and all later migrations canceled:
SQLite3::SQLException: table "todo_items" already exists: CREATE TABLE "todo_items" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "todo_list_id" integer, "content" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) /home/youta/rails_projects/odot/db/migrate/20151020021106_create_todo_items.rb:3:in change' -e:1:in' ActiveRecord::StatementInvalid: SQLite3::SQLException: table "todo_items" already exists: CREATE TABLE "todo_items" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "todo_list_id" integer, "content" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) /home/youta/rails_projects/odot/db/migrate/20151020021106_create_todo_items.rb:3:in change' -e:1:in' SQLite3::SQLException: table "todo_items" already exists /home/youta/rails_projects/odot/db/migrate/20151020021106_create_todo_items.rb:3:in change' -e:1:in' Tasks: TOP => db:migrate (See full trace by running task with --trace)
Чтобы решить эту проблему, я попытался удалить модель todo_item с помощью эти команды
грабли БД: RollBack
рельсы уничтожить модель todo_item
грабли БД: падение
грабли БД: установка
грабли БД: падение RAILS_ENV = тест
грабли БД: установка RAILS_ENV = тест
Хотя, когда я попытался переделать модель todo_item после удаления предыдущий я все равно получаю ту же ошибку!
я должен сбросить мерзавец .. если да, то как я могу сбросить его к предыдущей рабочей версии
Спасибо, он работал как шарм – youta