On Fri, Mar 21, 2008 at 10:01:47AM -0700, Subbu wrote:
I have modified an existing migration and I like to update the db with
that. But the problem is I’ll to run all the migrations in order for
this change to take affect. That means I’ll also loose all my data.
Is it possible to run just one migration? I know this is a weird case.
But I am interested in knowing if anybody has come across such a
situation and solved it.
This is what migrations are about. You don’t modify existing ones, you
create new ones. Whatever you are doing to your schema, do it
incrementally in a new migration and run that. If it involves modifying
data to perform the migration, put that in the migration as well.
Migrations are not just about creating database tables. Any schema
is a migration. Any migration (except those involving unrecoverable data
loss, which are very rare) should be reversible.