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.
7fbd0e99b27064b14793f028022974e5?d=identicon&s=25 Zhao Yi (youhaodeyi)
on 2008-12-31 06: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.
B14575f0ca69f10938fdd67e7156e0e1?d=identicon&s=25 Craig Demyanovich (Guest)
on 2008-12-31 06: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
B14575f0ca69f10938fdd67e7156e0e1?d=identicon&s=25 Craig Demyanovich (Guest)
on 2008-12-31 06: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 Demyanovich
C716fc4403801b02e67fe4c0fdec4e19?d=identicon&s=25 Ramu (Guest)
on 2009-01-01 14: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 Demyanovich
<cdemyanovich@gmail.com>wrote:

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


--
Ramu
059ed46172a087063ce26250e44c8627?d=identicon&s=25 Fernando Perez (fernando)
on 2009-01-01 14: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 Demyanovich
> <cdemyanovich@gmail.com>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.