All Projects → ParabolInc → migrate-rethinkdb

ParabolInc / migrate-rethinkdb

Licence: MIT license
A migration tool for rethink db

Projects that are alternatives of or similar to migrate-rethinkdb

Typeorm Nestjs Migration Example
"Example of how to use migrations feature of TypeORM with NestJS.
Stars: ✭ 176 (+1000%)
Mutual labels:  migrations
MoalemYar
A personal project for class management, using various technologies like WPF, Entityframwork, CodeFirst, Sqlite, Migration and more
Stars: ✭ 53 (+231.25%)
Mutual labels:  migrations
nmt
Network mapping tool
Stars: ✭ 16 (+0%)
Mutual labels:  rethinkdb
Cli
The Sequelize CLI
Stars: ✭ 2,248 (+13950%)
Mutual labels:  migrations
Peewee migrate
Simple migration engine for Peewee
Stars: ✭ 250 (+1462.5%)
Mutual labels:  migrations
gloat
Next-gen database migrations framework for Go.
Stars: ✭ 15 (-6.25%)
Mutual labels:  migrations
Postgres Migrations
🐦 A Stack Overflow-inspired PostgreSQL migration library with strict ordering and immutable migrations
Stars: ✭ 161 (+906.25%)
Mutual labels:  migrations
strong migrations
Catch unsafe migrations in your Elixir application
Stars: ✭ 58 (+262.5%)
Mutual labels:  migrations
elastic-migrations
Elasticsearch migrations for Laravel
Stars: ✭ 153 (+856.25%)
Mutual labels:  migrations
ava-rethinkdb
🔗 RethinkDB helpers for AVA
Stars: ✭ 24 (+50%)
Mutual labels:  rethinkdb
Migrate
Database migrations. CLI and Golang library.
Stars: ✭ 2,315 (+14368.75%)
Mutual labels:  migrations
Django Migration Linter
🚀 Detect backward incompatible migrations for your django project
Stars: ✭ 231 (+1343.75%)
Mutual labels:  migrations
leto
Leto: Realtime Application Stack [Angualr2, Rethinkdb/Horizon, ExpressJS] Web | Mobile | Desktop
Stars: ✭ 21 (+31.25%)
Mutual labels:  rethinkdb
Laravel Migrate Fresh
An artisan command to build up a database from scratch
Stars: ✭ 179 (+1018.75%)
Mutual labels:  migrations
migrations
Migrations is a database migration tool that uses go's database/sql from the standard library
Stars: ✭ 17 (+6.25%)
Mutual labels:  migrations
Django Swappable Models
Swapper - The unofficial Django swappable models API.
Stars: ✭ 169 (+956.25%)
Mutual labels:  migrations
perseus
Perseus is a set of scripts (docker+javascript) to investigate a distributed database's responsiveness when one of its three nodes is isolated from the peers
Stars: ✭ 49 (+206.25%)
Mutual labels:  rethinkdb
serverless-typeorm-migrations
Database migrations for AWS Lambda and RDS using TypeORM Migrations
Stars: ✭ 38 (+137.5%)
Mutual labels:  migrations
apistar alembic migrations
Alembic migrations for apistar
Stars: ✭ 18 (+12.5%)
Mutual labels:  migrations
underbase
MongoDB schema and data migration library based on semver
Stars: ✭ 19 (+18.75%)
Mutual labels:  migrations

migrate-rethinkdb

A migration tool for RethinkDB

Overview

migrate-rethinkdb is a utility allowing you to version changes to a RethinkDB database. Forward or backward migrate structural or data changes. Share and control these changes with other developers.

This code is a fork of Johan Obrink's rethink-migrate. migrate-rethinkdb is more actively maintained.

Install

$ npm install -g migrate-rethinkdb

Setup

Install a RethinkDB driver:

npm install --save rethinkdb

or

npm install --save rethinkdbdash

Create a database.json file in the root of your solution with the format:

{
  "host": "localhost",
  "port": 28015,
  "db": "migrations",
  "discovery": true,
  "timeout": 60
}

Other, optional, parameters are authKey and ssl.

You can also use environment variables or arguments to override.

Log levels

The default is info. This will log info, warnings and errors. Possible values for logLevel are "debug" | "info" | "warning" | "error" | "none".

Create migration

$ migrate-rethinkdb create [migration name]

For example:

migrate-rethinkdb create add-tables

Edit migration

Open the file ./migrations/[timestamp]-[migration name].js

Add the changes to be made. For example:

exports.up = function (r, connection) {
  return r.tableCreate('foo').run(connection);
};

exports.down = function (r, connection) {
  return r.tableDrop('foo').run(connection);
};

Run migrations

migrate-rethinkdb up --one will run one up migration.

migrate-rethinkdb up --all will run all outstanding up migrations.

migrate-rethinkdb down --one will run one down migration.

migrate-rethinkdb down --all will run all outstanding down migrations.

If either --all or --one isn't specified, --all is the default.

Options

migrate-rethinkdb up --root ./build will run all outstanding up migrations found in ./build/migrations with database.json in ./build. -r can be used as an alias.

migrate-rethinkdb up --logLevel debug will set logLevel to debug. Possible values are: debug | info | warning | error | none. -l can be used as an alias.

Run tests

Run docker-compose up If necessary, change the IP address in test/database.json Run gulp jshint test

To run tests continually, add watch to the gulp command

License

The MIT License (MIT)

Copyright (c) 2017 Parabol, Inc. Copyright (c) 2015 Johan Öbrink

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

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