All Projects → sundowndev → underbase

sundowndev / underbase

Licence: MIT license
MongoDB schema and data migration library based on semver

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to underbase

db-migrator.go
DB migrations. CLI and Golang
Stars: ✭ 13 (-31.58%)
Mutual labels:  migrations, migration-tool
butterfly
Application transformation tool
Stars: ✭ 35 (+84.21%)
Mutual labels:  migrations, migration-tool
n3dr
Nexus3 Disaster Recovery (N3DR) is a tool that is capable of downloading all artifacts from a Nexus3 server and to migrate them to another Nexus3 server. Note that some repository formats are not supported at the moment.
Stars: ✭ 110 (+478.95%)
Mutual labels:  backup, migration-tool
koa-mongoDB
😊😊Koa and mongoose build services
Stars: ✭ 24 (+26.32%)
Mutual labels:  mongoose
sicksync
Don’t accept the available as the preferable. Go the extra mile with extra speed.
Stars: ✭ 67 (+252.63%)
Mutual labels:  backup
IAmLazy
Easily backup and restore your tweaks
Stars: ✭ 37 (+94.74%)
Mutual labels:  backup
b2-sdk-php
SDK for Backblaze's B2 storage service.
Stars: ✭ 75 (+294.74%)
Mutual labels:  backup
MoalemYar
A personal project for class management, using various technologies like WPF, Entityframwork, CodeFirst, Sqlite, Migration and more
Stars: ✭ 53 (+178.95%)
Mutual labels:  migrations
react-redux-passport-uikit-express-boiler
A React+Redux boilerplate using Express as backend, UIKit for frontend, MongoDB for storage & Passport for auth.
Stars: ✭ 59 (+210.53%)
Mutual labels:  mongoose
butdr
Backup to Cloud( Google Drive, Dropbox ... ) use rclone
Stars: ✭ 49 (+157.89%)
Mutual labels:  backup
build-and-secure-restful-api
Source code for 'Build and Secure Restful API in Node.js, Express and MongoDB' course
Stars: ✭ 42 (+121.05%)
Mutual labels:  mongoose
erkab-web-app
Erkab - A student centric ride sharing website.
Stars: ✭ 21 (+10.53%)
Mutual labels:  mongoose
vulkano
A small, simple and fast framework for creating web applications using NodeJS. Inspired by KumbiaPHP.
Stars: ✭ 15 (-21.05%)
Mutual labels:  mongoose
mongodb-tree-structure
Implementing Tree Structure in MongoDB
Stars: ✭ 14 (-26.32%)
Mutual labels:  mongoose
gloat
Next-gen database migrations framework for Go.
Stars: ✭ 15 (-21.05%)
Mutual labels:  migrations
virt-backup
Fully backup your KVM Virtual Machines
Stars: ✭ 27 (+42.11%)
Mutual labels:  backup
open2fa
Two-factor authentication app with import/export for iOS and macOS. All codes encrypted with AES 256. FaceID & TouchID support included. Written with love in SwiftUI ❤️
Stars: ✭ 24 (+26.32%)
Mutual labels:  backup
planb
PlanB - automating remote backups and snapshots with zfs/rsync
Stars: ✭ 24 (+26.32%)
Mutual labels:  backup
vbo365-rest-self-service
Unofficial Self-Service Web Portal for Veeam Backup for Microsoft Office 365
Stars: ✭ 24 (+26.32%)
Mutual labels:  backup
VestaCP-Sync-Backups-To-Mega
VestaCP: uploading backups to the MEGA cloud
Stars: ✭ 17 (-10.53%)
Mutual labels:  backup

Underbase

MongoDB schema and data migration library

⚠️ Deprecation notice

This project has been discontinued as of August, 2020 since it didn't match my expectations. Feel free to fork or contribute by making pull requests to keep the project up to date and maintained. Renovate has been disabled, dependencies will no longer be updated. Only security patches will be published to npm.

What's this ?

Underbase is a MongoDB schema and data migration library that provides an easy-to-use abstract interface for writting, organizing and executing your database migrations. Usable both in the CLI and as a module, you can easily implement it in your framework's code base.

  • Promised: uses promises and async/await. No callback hell.
  • Flexible: Multiple databases support. Migrations can be grouped, organized. Migrator can have event listeners.
  • Scalable: uses MongoDB cursor and aggregator.
  • Testable: can be used with assertions.

Current status

The current API (v2.x) is stable and production ready.

Quick start

Install

npm install -g @underbase/cli

Underbase is compatible with any Node.js version above v8.x. ⚠️ As of March 2020, Underbase will drop support for Nodejs v8.x.

Configuration

// underbase.config.js
const path = require('path');

module.exports = {
  db: 'mongodb://localhost:27017/example_db',
  migrationsDir: __dirname,
  collectionName: '_migrations',
};

Usage

// migrations/1.0/index.js
module.exports = {
  version: 1.0,
  describe: 'Update users collection',
  async up({ Query }) {
    const Users = Query.collection('Users');

    await Users.rename('datecreated', 'dateCreated').where({
      datecreated: {
        $exists: true,
      },
    });
  },
  async down({ Query }) {
    const Users = Query.collection('Users');

    await Users.rename('dateCreated', 'datecreated').where({
      dateCreated: {
        $exists: true,
      },
    });
  },
};

Then, you can migrate :

# From 0 to 1.0
underbase migrate 1.0 --config underbase.config.js

Want to rerun current migration version ?

underbase rerun --config underbase.config.js

Want to rollback a migration ?

# From 1.0 to 0
underbase migrate 0 --config underbase.config.js

Documentation

Learn more about using Underbase on the official site!

Examples

Want to see real-world usage of Underbase ? We've created some examples for you.

Support

Underbase is continuously being tested with node v10 & v12, the latest version of the mongodb nodejs driver (3.x) and the latest version of the MongoDB docker image. Dependencies are frequently updated. It's compatible with any Node.js version above v8.x.

Contributing

  • Fork it!
  • Create your feature branch: git checkout -b feature/my-new-feature
  • Commit your changes: git commit -am 'Add some feature'
  • Push to the branch: git push origin feature/my-new-feature
  • Submit a pull request

README Badge

Using Underbase in an open-source project? Add a README badge to show it off: underbase

[![underbase](https://img.shields.io/badge/migrating with-underbase-2c3e50.svg)](https://sundowndev.github.io/underbase/)

Credits

This repository is a fork of emmanuelbuah/mgdb-migrator, which is a generic mongodb migration library based on percolatestudio/meteor-migrations. This fork was created in order to provide a CLI application to interact with the API and several new features.

Icon was made by Fabiana Antonioli and published on thenounproject.

License

MIT

© 2019-present Raphaël Cerveaux

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].