percolatestudio / meteor-migrations

Simple migration system for Meteor
https://atmospherejs.com/percolate/migrations
MIT License
245 stars 58 forks source link

Allow to create split migrations for same version. #47

Open ghost opened 8 years ago

ghost commented 8 years ago

Hi.

Looking for SRP I've changed your package to be able to create two or more migrations for the same version:

Migrations.add({up: function () {run.push('u1-2');}, version: 1});
Migrations.add({up: function () {run.push('u1-1');}, version: 1});

With this you can create migration packages for each service/model that have to be modified.

zol commented 8 years ago

Hey @LoeLobo - Thanks for creating this PR. I'm not going to merge it however as it breaks the mental model that the migrations package is designed with. I'll leave this PR open for a while to give others an opportunity to weigh in.

ubald commented 8 years ago

I support this idea. In a project made of many packages, I have a "collections" package that provide all the dependencies for other sub packages. This collection package configures meteor-migrations and then the individual packages all define their own migrations. I just have to increment the migration version globally based on the sprint/release number. This way, it is easier to keep track of what was migrated with each release.

If the order operations is important maybe an optional order option could be used to sort migrations from the same version.

ghost commented 6 years ago

Hi, is it still not possible to create split migrations for the same version?