Skip to main content

Migration engine for MongoDB

Project description

MongoDb Migrator

Migration engine for MongoDB

Installation

$ python -m pip install mmigrator

Configuration

init command (see below) will create a mmigrator.config.json file with following structure:

{
    "dist": "migrations",
    "connection": {
        "host": "",
        "port": "",
        "database": "",
        "user": "",
        "password": ""
    }
}

Connection variables could be set from any file.
e.g. from .env file:

"host": ".env[MONGO_HOST]",
"port": ".env[MONGO_PORT]",
"database": ".env[MONGO_DB]",
"user": ".env[MONGO_USER]",
"password": ".env[MONGO_PASSWORD]"

Usage

Help

$ mmigrator help

Init configs

optional, wil l run automatically on any migration command*

CLI

$ mmigrator init

from code:

from mmigrator import MigrationManager
...
MigrationManager.init()

Create migration

CLI

$ mmigrator g SomeName
# or
$ mmigrator new SomeName

from code:

MigrationManager.generate("SomeName")

Run migrations

CLI

$ mmigrator migrate

from code:

MigrationManager.migrate()

Revert migrations

CLI

$ mmigrator revert

from code:

MigrationManager.revert()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mmigrator-0.1.2.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mmigrator-0.1.2-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file mmigrator-0.1.2.tar.gz.

File metadata

  • Download URL: mmigrator-0.1.2.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for mmigrator-0.1.2.tar.gz
Algorithm Hash digest
SHA256 d2439016ffd3a942f5d6f689780d62a08a4f72cd3d5eeff30b0f106dfa0dd799
MD5 6e88f6dbc39342574b3e1510ae956abe
BLAKE2b-256 87d5a0d7828fa6621e545e9866e883f909c04a75438f57f0221e01f4e9e577ff

See more details on using hashes here.

File details

Details for the file mmigrator-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: mmigrator-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for mmigrator-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7cf05784740da0e73c5dafb98a23a1aa76109c7299d731e9e73597afd6a96a23
MD5 cdc11706a3ddd5a57220e389a5f5c153
BLAKE2b-256 22338042798dc4510c1e52247fcb2eefc1a6bb867e4c0eab3f2ee2b8e308c907

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page