0

So this is probably pretty easy. I'm not finding anything in RubyMine documentation or Google. I previously generated a migration as:

Proposal name:string date:date title:string text:text user:references

After wanting to make a change I went through and deleted everything, or so I thought out of my rails project. This is what I get when I attempt re-generate and run db:migrate

SQLite3::SQLException: table "proposals" already exists: CREATE TABLE "proposals" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "date" date, "title" varchar(255), "text" text, "user_id" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)

So where else do I have to go to delete my table?

LazyOne
  • 158,824
  • 45
  • 388
  • 391
Matt
  • 559
  • 6
  • 15
  • 27

2 Answers2

1

Ruby mine I'm not sure, but If you want to roll back the latest migration its

in your console

rake db:rollback

if you want to revert the previous generator action Ex:

rails g scaffold User name:string

and you want to revert all of the code generated

rails destroy scaffold User

HTH

sameera207
  • 16,547
  • 19
  • 87
  • 152
1

See This

http://guides.rubyonrails.org/migrations.html

And try in your terminal - rake db:rollback

Dipak Panchal
  • 5,996
  • 4
  • 32
  • 68
  • Thanks after reading the migrations guide I ended up having to db:reset and choosing where to reset too. – Matt Dec 31 '12 at 20:18