Do you have to use migrations from the beggining, or can you start with an allready existing DB and build upon it with migrations ?
surfivor wrote:
Do you have to use migrations from the beggining, or can you start with an allready existing DB and build upon it with migrations ?
Yes.
Hi --
Do you have to use migrations from the beggining, or can you start with an allready existing DB and build upon it with migrations ?
You can use migrations on an existing database. In general, though, if you use migrations, they really want to be in charge; it's error-prone to mix migrations and other database-changing techniques, because the migration system has its own idea of what level the database is at and what's there. So it's probably best either to decide to switch entirely to migrations (possibly even dumping the schema into migration-friendly form and reloading it, though that may be overkill) or avoid them.
David
Naturally Yes.
But take a care about the situation when you would like to go back with db:migrate VERSION = 0.
Perhaps you would like to make the situation where you can go to the empty database and to be able to build from the scratch with migrations.
One more thing, kip in mind the same situation has to be met in production environment.
dima