This would suggest that the migration you were running was attempting to add
the artists table.  I think this is nothing to do with rake
db:sessions:create.  Have a look in the migration made by the rake to see
what it is doing.  I imagine that you have an earlier migration that created
the artists table and for some reason that is running again.

Colin

2009/5/27 Mk 27 <[email protected]>

>
> I was following this set of instructions from the "Cookie overflow?"
> thread:
>
> > Your sessions (by default in cookie) needs to be moved to Active record
> > store or memcache store to fix this issue.
> >
> > For Databased sessions:
> > config.action_controller.session_store = :active_record_store
> > You need to create the session table as below
> > rake db:sessions:create
> > rake db:migrate
>
> I added the config line to environment.rb; is that the approriate place?
>
> When I ran the migration, I got
>
> rake aborted!
> An error has occurred, this and all later migrations canceled:
>
> SQLite3::SQLException: table "artists" already exists: [etc]
>
> So I removed the existing, populated database (to a safe place, since I
> do not want to have to create it again unless necessary) and ran the
> rake db:migrate again...clearly there is something I don't understand
> because most sane people would want to preserve the contents of an
> existing db when they modify it.
>
> Now I have a problem, because of course the new (empty) database has an
> extra table in it.  Before I go and write a ruby script to create a
> database containing my old records + the new table as it appears in
> schema.rb, is there not a simpler, more sensible way to do this?
>
> If I do have to remake the db manually, can anyone answer a questions
> for me regarding the session table: Does it also use a column "id" as
> the INTEGER PRIMARY KEY?  I suppose it won't matter if it doesn't and I
> put one in anyway...
> --
> Posted via http://www.ruby-forum.com/.
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to