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.1.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.1-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mmigrator-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 839b2826fe5c1bdc55d8d1c31005c08eb035a7d76565abc245c9edcfd622e800
MD5 b39f833a760210c1e623fba4d5484d56
BLAKE2b-256 f336081f8c3d9f6dec9ac46dd423dcb8abc33e9cc0a9f59e03128bb3f0ec92b8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mmigrator-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5d3c7c81793f442cc123a41cfcb2f6c09e6576e9563c9dddd366a4685c29d0de
MD5 b4bbb2dd945b51029ff7a7530261f59c
BLAKE2b-256 86a2c6e564bbdd697144fefed6a69cf42bff891848ccc8dfe7f876eafc2b5d6e

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