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 .env|.json files.
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.3.tar.gz (5.7 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.3-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mmigrator-0.1.3.tar.gz
  • Upload date:
  • Size: 5.7 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.3.tar.gz
Algorithm Hash digest
SHA256 a45f41395b010c7d8bbf0f73c11495c36796dda9916f6c21aaeee4bdb082a0d0
MD5 bf97113a33016c23d82f666487e994c7
BLAKE2b-256 cd9a8f0e051002d557145b63ab143779a5010db27d63f4fc18ed12c2b0f0f516

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mmigrator-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 7.3 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b05a52e082d3c6678534725b63e4c580901b354a8dc7097e8ad571c61fc4154f
MD5 980c564092a7455011858457f3b3f1e0
BLAKE2b-256 5db1a81690c142e3d5b6961e98bd437a00558356505f16af826f21ab2e4cc565

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