All Projects → kevlened → Fireway

kevlened / Fireway

Licence: mit
A schema migration tool for firestore

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Fireway

Firetable
Excel/Google Sheets like UI for Firebase/Firestore. No more admin portals!
Stars: ✭ 1,115 (+1015%)
Mutual labels:  firebase, firestore
Firebase Course
Firebase & AngularFire In Depth
Stars: ✭ 96 (-4%)
Mutual labels:  firebase, firestore
Instadart Flutter Instagram Clone
Instagram Clone App Using - Dart, Flutter, Firebase
Stars: ✭ 66 (-34%)
Mutual labels:  firebase, firestore
Tiledesk Dashboard
The Tiledesk dashboard. Tiledesk is an Open Source Live Chat platform written in NodeJs, firebase and Angular.
Stars: ✭ 53 (-47%)
Mutual labels:  firebase, firestore
Firebase dart sdk
Unofficial Firebase Flutter SDK. Maintainer: @long1eu
Stars: ✭ 80 (-20%)
Mutual labels:  firebase, firestore
Angular 4 Material Pos
POS written in Angular 4 with Angular Material UI
Stars: ✭ 54 (-46%)
Mutual labels:  firebase, firestore
Integrify
🤝 Enforce referential and data integrity in Cloud Firestore using triggers
Stars: ✭ 74 (-26%)
Mutual labels:  firebase, firestore
Nativescript Plugin Firebase
🔥 NativeScript plugin for Firebase
Stars: ✭ 990 (+890%)
Mutual labels:  firebase, firestore
Gatsby Theme Firebase
🔥 A Gatsby Theme for adding Firebase to your application.
Stars: ✭ 96 (-4%)
Mutual labels:  firebase, firestore
Firegraph
GraphQL Superpowers for Google Cloud Firestore
Stars: ✭ 80 (-20%)
Mutual labels:  firebase, firestore
Ember Cloud Firestore Adapter
Unofficial Ember Data Adapter and Serializer for Cloud Firestore
Stars: ✭ 51 (-49%)
Mutual labels:  firebase, firestore
React Native Firebase
🔥 A well-tested feature-rich modular Firebase implementation for React Native. Supports both iOS & Android platforms for all Firebase services.
Stars: ✭ 9,674 (+9574%)
Mutual labels:  firebase, firestore
Firestorerecycleradaptersample
Sample Android project using FirestoreRecyclerAdapter
Stars: ✭ 43 (-57%)
Mutual labels:  firebase, firestore
Tiledesk Server
Tiledesk server. Tiledesk is an Open Source Live Chat platform written in NodeJs and MongoDB
Stars: ✭ 94 (-6%)
Mutual labels:  firebase, firestore
Paginate firestore
A flutter package to simplify pagination with firestore data 🗃
Stars: ✭ 40 (-60%)
Mutual labels:  firebase, firestore
Mock Cloud Firestore
Mock library for Cloud Firestore
Stars: ✭ 69 (-31%)
Mutual labels:  firebase, firestore
Firextensions
[DEPRECATED] 🔥 Unofficial Kotlin Extensions for the Firebase Android SDK.
Stars: ✭ 30 (-70%)
Mutual labels:  firebase, firestore
Social Note
Social Note - Note-taking, sharing, time & location reminder
Stars: ✭ 38 (-62%)
Mutual labels:  firebase, firestore
Jotify
Sticky notes reimagined - written in Swift
Stars: ✭ 79 (-21%)
Mutual labels:  firebase, firestore
The Road To React With Firebase
📓The Road to React with Firebase: Your journey to build business applications with React and Firebase.
Stars: ✭ 82 (-18%)
Mutual labels:  firebase, firestore

fireway

A schema migration tool for firestore heavily inspired by flyway

Install

yarn add -G fireway

# or 

npx fireway

CLI

Usage
  $ fireway <command> [options]

Available Commands
  migrate    Migrates schema to the latest version

For more info, run any command with the `--help` flag
  $ fireway migrate --help

Options
  -v, --version    Displays current version
  -h, --help       Displays this message

fireway migrate

Description
  Migrates schema to the latest version

Usage
  $ fireway migrate [options]

Options
  --path         Path to migration files  (default ./migrations)
  --projectId    Target firebase project
  --dryrun       Simulates changes
  -h, --help     Displays this message

Examples
  $ fireway migrate
  $ fireway migrate --path=./my-migrations
  $ fireway migrate --projectId=my-staging-id
  $ fireway migrate --dryrun

Migration file format

Migration file name format: v[semver]__[description].js

// each script gets a pre-configured firestore admin instance
// possible params: app, firestore, FieldValue, FieldPath, Timestamp, dryrun
module.exports.migrate = async ({firestore, FieldValue}) => {
    await firestore.collection('name').add({key: FieldValue.serverTimestamp()});
};

Running locally

Typically, fireway expects a --projectId option that lets you specify the Firebase project associated with your Firestore instance against which it performs migrations. However, most likely you'll want to test your migration scripts locally first before running them against your actual (presumably, production) instances. If you are using the Firestore emulator, define the FIRESTORE_EMULATOR_HOST environment variable, e.g.:

export FIRESTORE_EMULATOR_HOST="localhost:8080"

The firestore node library will connect to your local instance. This way, you don't need a project ID and migrations will be run against your emulator instance. This works since fireway is built on the firestore node library.

Migration logic

  1. Gather all the migration files and sort them according to semver
  2. Find the last migration in the fireway collection
  3. If the last migration failed, stop. (remove the failed migration result or restore the db to continue)
  4. Run the migration scripts since the last migration

Migration results

Migration results are stored in the fireway collection in firestore

// /fireway/3-0.0.1-example

{
  checksum: 'fdfe6a55a7c97a4346cb59871b4ce97c',
  description: 'example',
  execution_time: 1221,
  installed_by: 'system_user_name',
  installed_on: firestore.Timestamp(),
  installed_rank: 3,
  script: 'v0.0.1__example.js',
  success: true,
  type: 'js',
  version: '0.0.1'
}

Contributing

# To install packages and firestore emulator
$ yarn
$ yarn setup

# To run tests
$ yarn test

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].