Are there any concepts for firestore db schema migrations comparable to rails ActiveRecord migrations?

I couldn't find a firestore schema migration tool, so I wrote fireway. It's currently very simple (it doesn't support reversing a migration), but it's been enough for my use case.

Here's an example migration script:

// migrations/v0.0.1__example.js

module.exports.migrate = async ({firestore}) => {
    await firestore.collection('name').add({key: 'value'});
};

Then run fireway migrate to migrate your default project.


Currently, for Firestore, you will have to write your own code to update all existing documents to the new (implicit) schema. I read a few weeks ago in a post, that Firestore team is working on making this easier in the future.

If your new schema require some changes in your entire database, you can also consider using Firestore import / export system, that allows you to dump your data into a GCS bucket. It is not in a JSON format as you probably expected but it is in a similar format as Cloud Datastore uses, so I think will help you solve this problem.