Hi! In my db i store things like articles... and they are given an id like 17 or somthing. When i then delete article 17 and create a new one that one will have id 17, my question is: Is there a way to give that articel id 18? I use sqlite3. Thanks -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Tue, Aug 26, 2008 at 5:20 AM, Mikael Björkegren <rails-mailing-list@andreas-s.net> wrote:> > Hi! > > In my db i store things like articles... and they are given an id like > 17 or somthing. When i then delete article 17 and create a new one that > one will have id 17, my question is: Is there a way to give that articel > id 18? > > I use sqlite3. >Assuming that you're following conventions, sqlite should automatically increment the id with each new record. Did you use migrations to create the database? Robby -- Robby Russell Chief Evangelist, Partner PLANET ARGON, LLC design // development // hosting http://www.planetargon.com/ http://www.robbyonrails.com/ aim: planetargon +1 503 445 2457 +1 877 55 ARGON [toll free] +1 815 642 4068 [fax] --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
The server increment the id, i only check locally and there i didn''t have that. So thank you for make me check that, so my problem is solved. thanks> Assuming that you''re following conventions, sqlite should > automatically increment the id with each new record. Did you use > migrations to create the database?> Chief Evangelist, Partner > > PLANET ARGON, LLC > design // development // hosting > > http://www.planetargon.com/ > http://www.robbyonrails.com/ > aim: planetargon > > +1 503 445 2457 > +1 877 55 ARGON [toll free] > +1 815 642 4068 [fax]-- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---