New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

arangomigration

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

arangomigration

ArangoDB migration cli tool

latest
Source
npmnpm
Version
1.0.3
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

Arango Migration Tool

This tool will help you to manage your ArangoDB with migration file to easily create users, document, indexes & views from a simple folder with yaml files.

It can also insert default data from the same folder.

Getting started

1. Installation

# install localy, so you can use it with npx in your folder
npm install arangomigration

# or install globaly to get access to the cli from anywhere
npm install -g arangomigration

2. Add some migration files

  • Create a migration folder at your project root
  • Add yaml files in semvers format with a name: x.x.x-add-a-collection.yml

Your folder should look like this:

./migration
├── 1.0.0-mvp-needs.yml
└── 1.0.1-add-missing-index.yml

3. Write a migration file

database: my-database

create:
  users:
    - username: user1
      password: usernamepassword
  collection:
    - name: dogs
    - name: dogSitter
  edgeCollection:
    - name: dogSitterDogs
  indexes:
    - name: oneDogSitterForADog
      collection: dogSitterDogs
      type: persistent
      unique: true
      fields:
        - _from
        - _to

This migration file will do:

  • Create my-database database if not exist
  • Create user1 user in _system database
  • Create a collection and an edge collection
  • Create a persistent index on the edgeCollection dogSitterDogs to ensure that a dog has only a dog sitter

Run migration

This tool is a cli, so you can basicly use this command line

(npx) arangomigration migrate

Main commands

$ arangomigration arangomigration --help

Usage: arangomigration [options] [command]

Options:
  -v, --version                 output the version number
  -h, --help                    display help for command

Commands:
  apply [options] [directory]   Apply all migration files from a directory
  status [options] [directory]  Check local file and compare to previously applied migration
  help [command]                display help for command

Apply command

$ arangomigration apply --help

Usage: arangomigration apply [options] [directory]

Apply all migration files from a directory

Options:
  --url <url>              URL of your database (default: "http://localhost:8529")
  --username <username>    System username (default: "root")
  --password <password>    System user password (default: "root")
  --insert-data <boolean>  Insert data from ~/your-migration-folder/data (default: true)
  -h, --help               display help for command

Status command

$ arangomigration status --help

Usage: arangomigration status [options] [directory]

Check local file and compare to previously applied migration

Options:
  --url <url>            URL of your database (default: "http://localhost:8529")
  --username <username>  System username (default: "root")
  --password <password>  System user password (default: "root")
  -h, --help             display help for command

Keywords

ArangoDB

FAQs

Package last updated on 05 Oct 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts