Discussion:
Consolidation of ERXMigrations
Kai Lochbaum
2018-11-13 16:09:05 UTC
Permalink
Hi everyone,

over the years we have accumulated lots of migration versions in multiple models (one at 66, another at 54).

Did anyone ever think about some sort of consolidation to make the initial migration on a fresh database quicker?

I was thinking of something like a “skipToVersion” method where you would update your 0-Migration with the most current database model and add a skipToVersion(66) call at the end, so that ERXMigration directly skips from 0 to 66.



Cheers,
Kai Lochbaum
--
Telefon: 069 / 65 00 96 - 17 | E-Mail: ***@salient-doremus.de<mailto:***@salient-doremus.de>

salient GmbH, Lindleystraße 12, 60314 Frankfurt
Telefon Zentrale: 069 / 65 00 96 - 0 | http://www.salient-doremus.de<http://www.salient-doremus.de/>
Jesse Tayler
2018-11-13 16:41:14 UTC
Permalink
I don’t see why not -- migrations keep a version available in the db to test against so the condition of the db can be anywhere along the line from no updates to half way or whatever this number just has to be in sync with the right level of update.

So, you don’t want to disrupt that continuity but that doesn’t mean you can’t write something in the first section that runs if the db version is zero and pushes it to completed version or something.

Migrations is a very simple mechanism so just be sure you understand the version number stored and how to adjust or use it and you should be fine.

Handily, Migrations are easy to run in a series of tests to prove it is ok before you release on production.
Post by Kai Lochbaum
Hi everyone,
over the years we have accumulated lots of migration versions in multiple models (one at 66, another at 54).
Did anyone ever think about some sort of consolidation to make the initial migration on a fresh database quicker?
I was thinking of something like a “skipToVersion” method where you would update your 0-Migration with the most current database model and add a skipToVersion(66) call at the end, so that ERXMigration directly skips from 0 to 66.
Cheers,
Kai Lochbaum
--
salient GmbH, Lindleystraße 12, 60314 Frankfurt
Telefon Zentrale: 069 / 65 00 96 - 0 | http://www.salient-doremus.de <http://www.salient-doremus.de/>_______________________________________________
Do not post admin requests to the list. They will be ignored.
https://lists.apple.com/mailman/options/webobjects-dev/jtayler%40oeinc.com <https://lists.apple.com/mailman/options/webobjects-dev/jtayler%40oeinc.com>
Loading...