0.3.1 • Published 7 years ago

fire-migrate v0.3.1

Weekly downloads
11
License
ISC
Repository
github
Last release
7 years ago

fire-migrate

CircleCI

fire-migrate is a tool to source control your migrations for firebase. It's the equivalent of liquibase for firebase.

fire-migrate verifies consecutive migrations and cross process locks.

To use call fireMigrate with the URL of your firebase application and an array of functions containing your firebase migrations. Each of the functions must call their first argument resolve() once the migration is complete.

fire-migrate matches the migrations by the name of the functions so if the name changes it will be reran.

npm install --save fire-migrate

Example:

var fireMigrate = require('fire-migrate');
var databaseRef = Firebase.initializeApp({
  apiKey: 'apiKey',
  authDomain: 'projectId.firebaseapp.com',
  databaseURL: 'https://example.firebaseio.com'
}).database().ref();

fireMigrate.migrate(databaseRef, [migration1, migration2]).then(() => {
  // continue with the rest of the application   
});

function migration1(resolve) {
  firebaseRef.push({
    //some data
  },resolve);
}

function migration2(resolve) {
  firebaseRef.push({
    //some data
  },resolve);
}
0.3.1

7 years ago

0.3.0

7 years ago

0.2.0

8 years ago

0.1.6

8 years ago

0.1.5

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago