herteby:migrate

v1.0.2Published 7 years ago

This package has not had recent updates. Please investigate it's current state before committing to using it in your project.

Migrate

Ultra-simple way to create migrations that run only once

meteor add herteby:migrate
1import migrate from 'meteor/herteby:migrate'
2
3migrate([
4  ()=>{
5    Collection.update()
6  },
7  ()=>{
8    Collection2.update()
9  }
10  //etc.
11])

Each time migrate() is run, it turns each function into a string, and checks for a match in the _migrations collection. If no match is found, it runs the function and inserts the string into the collection. If any change is done to the function (except spacing, indentation, comments and semicolons) it will count as new and be executed again.