rubyonrailsin

A Ruby and Rails talk

Sunday, March 21, 2010


[Rails] Re: Changing Scafflolds

by rubyonrailsin 0 comments

Tag


Share this post:
Design Float
StumbleUpon
Reddit

NEVER MIND. I was being an idiot. I just deleted the old migration
file that was causing the problems; and then created a new migration
file to get the new stuff in..

Thanks Guys,

-Joe

On Mar 21, 4:25 pm, yout...@dev-hq.co.uk wrote:
> Ok, So I figure I have to roll the database back and then migrate it
> again.
>
> However it just isnt doing anything when I call "rake db:rollback", or
> even specify a STEP:
>
> >rake db:rollback STEP=4
>
> (in C:/Users/user/Documents/Aptana Studio Workspace/ProductCatalog)>rake db:rollback STEP=10
>
> (in C:/Users/user/Documents/Aptana Studio Workspace/ProductCatalog)>rake db:migrate
>
> (in C:/Users/user/Documents/Aptana Studio Workspace/ProductCatalog)
> ==  CreateCategories: migrating
> ===============================================
> -- create_table(:categories)
> rake aborted!
> 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, "name"
> varchar(255), "image" varchar(255), "created_at" datetime,
> "updated_at" datetime)
>
> (See full trace by running task with --trace)
>
> I just cant figure out why it wont rollback...
>
> Please Help,
>
> Thanks In Advance,
>
> Joe
>
> On Mar 21, 2:26 pm, Colin Law <clan...@googlemail.com> wrote:
>
> > On 21 March 2010 13:40,  <yout...@dev-hq.co.uk> wrote:
>
> > > Ok, I seem to have a problem already.
>
> > > So first of all with these things, can I just change it in db/migrate/
> > > WhateverFile.rb ?
> > > Then when I have changed it how do I put these changes into action?
>
> > I suggest you have a look at the rails guides athttp://guides.rubyonrails.org/.  Start with Getting Started, not
> > surprisingly, then the next one is Database Migrations which should
> > sort out your current problems.  Then move on and work you way through
> > the others.
>
> > The ones on ActiveRecord Associations and Debugging are compulsory reading.
>
> > Colin

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment

Subscribe feeds via e-mail

Blog Archive