MongoDB Migrations for Python 3.5+
Project description
Mongrations
A MongoDB migrations tool for Python 3.5+.
Install
pip install --upgrade mongrations
or
git clone https://github.com/ableinc/mongrations.git
cd mongrations
pip install --upgrade .
Use
Mongrations comes with a CLI Tool as well as a class for a pythonic migration approach
CLI
Usage: mongrations [OPTIONS]
Options:
-M, --migrate BOOLEAN Run MongoDB migrations
-C, --create BOOLEAN Create new MongoDB migration
-N, --name TEXT Name for newly created migration
-F, --file_path TEXT File path for newly created migration
-U, --undo BOOLEAN Undo last MongoDB migration
-D, --down BOOLEAN Clean MongoDB database
--version Show the version and exit.
--help Show this message and exit.
CLI Examples
mongrations -C true --name [migration_name] # create new migration
mongrations -M true # run migrations
mongrations -D true # tear down migrations
mongrations -U true # undo last migration
Mongrations Class
from mongrations import MongrationsCli
migrations = MongrationsCli()
migrations.create(file_path='file/path', name='file_name')
migrations.migrate()
migrations.down()
migrations.undo()
Run example migration in examples/ folder
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mongrations-0.0.1.tar.gz
(4.2 kB
view hashes)
Built Distribution
Close
Hashes for mongrations-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 55ef06f60c24684a1ab5c93bfcff732d8a9c8ccde3d7372cfcd6d920bcbac310 |
|
MD5 | ec7608a9d176e22f63f76cf9712b8895 |
|
BLAKE2b-256 | 0bf31ad9ef80030288cde66b6f04570e25510737f1228a41e0928d7223e91c8c |