How to update table column?


#1

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.


#2

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


#3

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 D.


#4

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.invalidwrote:

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.


#5

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.invalidwrote:

http://guides.rails.info/migrations.html for more details.

type in this table. I modified the file


Ramu