Forum: Ruby on Rails How to update table column?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Zhao Y. (Guest)
on 2008-12-31 07:21
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.
Craig D. (Guest)
on 2008-12-31 07:32
(Received via mailing list)
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
Craig D. (Guest)
on 2008-12-31 07:35
(Received via mailing list)
Here's a more specific URL:
http://guides.rails.info/migrations.html#_changing... .

Craig

On Wed, Dec 31, 2008 at 12:31 AM, Craig D.
Ramu (Guest)
on 2009-01-01 15:02
(Received via mailing list)
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 D.
<removed_email_address@domain.invalid>wrote:

>> http://guides.rails.info/migrations.html for more details.
>>> type in this table. I modified the file
> >
>


--
Ramu
Fernando P. (Guest)
on 2009-01-01 15:41
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 D.
> <removed_email_address@domain.invalid>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.
This topic is locked and can not be replied to.