There is a table existed in sqlite3 database. I want to change a column type in this table. I modified the file db/migrate/20081229XXXX_create_project.rb and run "rake db:migrate". But it doesn''t update the table. How can I update the table with the new definition. -- 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 -~----------~----~----~----~------~----~------~--~---
Generally, don''t edit migrations. Instead, write a new one. See http://guides.rails.info/migrations.html for more details. Regards, Craig On Wed, Dec 31, 2008 at 12:21 AM, Zhao Yi <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>wrote:> > There is a table existed in sqlite3 database. I want to change a column > type in this table. I modified the file > db/migrate/20081229XXXX_create_project.rb and run "rake db:migrate". But > it doesn''t update the table. How can I update the table with the new > definition. > -- > 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 -~----------~----~----~----~------~----~------~--~---
Here''s a more specific URL: http://guides.rails.info/migrations.html#_changing_migrations . Craig On Wed, Dec 31, 2008 at 12:31 AM, Craig Demyanovich <cdemyanovich-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote:> Generally, don''t edit migrations. Instead, write a new one. See > http://guides.rails.info/migrations.html for more details. > > Regards, > Craig > > > On Wed, Dec 31, 2008 at 12:21 AM, Zhao Yi < > rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: > >> >> There is a table existed in sqlite3 database. I want to change a column >> type in this table. I modified the file >> db/migrate/20081229XXXX_create_project.rb and run "rake db:migrate". But >> it doesn''t update the table. How can I update the table with the new >> definition. >> -- >> 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 -~----------~----~----~----~------~----~------~--~---
Write a migration file with current version + 1 ex: say your version number in database 1024 then create migrate file 1025_job_name.rb run migrate On Wed, Dec 31, 2008 at 11:04 AM, Craig Demyanovich <cdemyanovich-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote:> Here''s a more specific URL: > http://guides.rails.info/migrations.html#_changing_migrations . > > Craig > > > On Wed, Dec 31, 2008 at 12:31 AM, Craig Demyanovich < > cdemyanovich-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> Generally, don''t edit migrations. Instead, write a new one. See >> http://guides.rails.info/migrations.html for more details. >> >> Regards, >> Craig >> >> >> On Wed, Dec 31, 2008 at 12:21 AM, Zhao Yi < >> rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: >> >>> >>> There is a table existed in sqlite3 database. I want to change a column >>> type in this table. I modified the file >>> db/migrate/20081229XXXX_create_project.rb and run "rake db:migrate". But >>> it doesn''t update the table. How can I update the table with the new >>> definition. >>> -- >>> Posted via http://www.ruby-forum.com/. >>> >>> >>> >> > > > >-- Ramu --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Ramu wrote:> Write a migration file with current version + 1 > ex: > > say your version number in database 1024 > > then create migrate file 1025_job_name.rb > run migrate > On Wed, Dec 31, 2008 at 11:04 AM, Craig Demyanovich > <cdemyanovich-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote: >Haven''t you switched to UTC timestamps migrations? That''s so easy to handle. And avoid editing manually your migrations, the only exception is if you edit the last migration (if no data was added) and rollback then remigrate, but in mot cases avoid it. -- 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 -~----------~----~----~----~------~----~------~--~---