# pymongo-migrate
[![Build Status](https://travis-ci.org/stxnext/pymongo-migrate.svg?branch=master)](https://travis-ci.org/stxnext/pymongo-migrate)
[![PyPI version](https://badge.fury.io/py/pymongo-migrate.svg)](https://badge.fury.io/py/pymongo-migrate)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pymongo-migrate.svg)
Mongodb migrations using Python.
Since mongodb is schema-less most of the time you can do without data migrations.
Sometimes tho you want to create some new entities, or migrate old data instead adding another IF statement to your code.
This is where `pymongo-migrate` comes in.
## Usage
Usage: pymongo-migrate [OPTIONS] COMMAND [ARGS]...
Options:
--help Show this message and exit.
Commands:
downgrade apply necessary downgrades to reach target migration
graph
migrate automagically apply necessary upgrades or downgrades to reach
target migration
show show migrations and their status
upgrade apply necessary upgrades to reach target migration
The most used command will be `migrate`, which works can be called like this:
$ pymongo-migrate migrate -u 'mongodb://localhost/test_db' -m tests/migrations
Use `pymongo-migrate command --help` to learn more about particular command.
## Development & contributing to the project
Contributions and raising Issues is welcome; standard netiquette rules apply.
Use `make init` to setup the project for development.
To format your code & test your changes run:
make check
## Alternatives
ATM there seem only two active python projects like this:
* https://github.com/DoubleCiti/mongodb-migrations
* https://github.com/skynyrd/cikilop
So if something already existed, why then another project?
Goals of this project, where at least one of them were not fulfilled by above:
* tests and CI pipeline for ensuring that tool indeed works
* keeping it usable both as standalone tool and as python dependency
* use of modern Python version, which allows use of type annotations, dataclasses, f-strings and other goodies
## Inspiration and design
Other than Alternatives mentioned above, both `alembic` and `django` were used as references when designing this tool.
For now only linear revision history is supported.
The support for squash migrations is planned.
Raw data
{
"_id": null,
"home_page": "",
"name": "pymongo-migrate",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "",
"keywords": "mongo,mongodb,pymongo,migrate,migration",
"author": "",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/b0/c6/57e64aa7f13e046e9b38897ae743930d455ad40625df25bcd0f3c8d4b5f0/pymongo-migrate-1.0.0.tar.gz",
"platform": null,
"description": "# pymongo-migrate\n\n[![Build Status](https://travis-ci.org/stxnext/pymongo-migrate.svg?branch=master)](https://travis-ci.org/stxnext/pymongo-migrate)\n[![PyPI version](https://badge.fury.io/py/pymongo-migrate.svg)](https://badge.fury.io/py/pymongo-migrate)\n\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pymongo-migrate.svg)\n\nMongodb migrations using Python.\n\nSince mongodb is schema-less most of the time you can do without data migrations.\nSometimes tho you want to create some new entities, or migrate old data instead adding another IF statement to your code.\nThis is where `pymongo-migrate` comes in.\n\n## Usage\n\n Usage: pymongo-migrate [OPTIONS] COMMAND [ARGS]...\n\n Options:\n --help Show this message and exit.\n\n Commands:\n downgrade apply necessary downgrades to reach target migration\n graph\n migrate automagically apply necessary upgrades or downgrades to reach\n target migration\n show show migrations and their status\n upgrade apply necessary upgrades to reach target migration\n\n\nThe most used command will be `migrate`, which works can be called like this:\n\n $ pymongo-migrate migrate -u 'mongodb://localhost/test_db' -m tests/migrations\n\nUse `pymongo-migrate command --help` to learn more about particular command.\n\n## Development & contributing to the project\n\nContributions and raising Issues is welcome; standard netiquette rules apply.\n\nUse `make init` to setup the project for development.\nTo format your code & test your changes run:\n\n make check\n\n## Alternatives\n\nATM there seem only two active python projects like this:\n * https://github.com/DoubleCiti/mongodb-migrations\n * https://github.com/skynyrd/cikilop\n\nSo if something already existed, why then another project?\n\nGoals of this project, where at least one of them were not fulfilled by above:\n * tests and CI pipeline for ensuring that tool indeed works\n * keeping it usable both as standalone tool and as python dependency\n * use of modern Python version, which allows use of type annotations, dataclasses, f-strings and other goodies\n\n## Inspiration and design\n\nOther than Alternatives mentioned above, both `alembic` and `django` were used as references when designing this tool.\n\nFor now only linear revision history is supported.\nThe support for squash migrations is planned.\n",
"bugtrack_url": null,
"license": "Apache Software License",
"summary": "MongoDB data migration tool in Python",
"version": "1.0.0",
"project_urls": {
"Changelog": "https://github.com/stxnext/pymongo-migrate/blob/main/CHANGELOG.md",
"Homepage": "https://github.com/stxnext/pymongo-migrate"
},
"split_keywords": [
"mongo",
"mongodb",
"pymongo",
"migrate",
"migration"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "03d7e3fe8d07b85f31e8304c8723f03003dfcac5c68b6505cdb379418a08f5b1",
"md5": "e8a1ec0671ada8080f7a0c3606dd5b22",
"sha256": "7b5303233ce7fab35618239f4737287185ec2abf10b5cdacf3c80ec88a09eac2"
},
"downloads": -1,
"filename": "pymongo_migrate-1.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "e8a1ec0671ada8080f7a0c3606dd5b22",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 13691,
"upload_time": "2023-06-30T07:55:34",
"upload_time_iso_8601": "2023-06-30T07:55:34.202213Z",
"url": "https://files.pythonhosted.org/packages/03/d7/e3fe8d07b85f31e8304c8723f03003dfcac5c68b6505cdb379418a08f5b1/pymongo_migrate-1.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b0c657e64aa7f13e046e9b38897ae743930d455ad40625df25bcd0f3c8d4b5f0",
"md5": "8f1d096f62713fb476d642cb1c60ed14",
"sha256": "7021abd27c42dbc991adc667694c9dc89f22c9d9c4d191d0dd684f05d56798f6"
},
"downloads": -1,
"filename": "pymongo-migrate-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "8f1d096f62713fb476d642cb1c60ed14",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 15249,
"upload_time": "2023-06-30T07:55:35",
"upload_time_iso_8601": "2023-06-30T07:55:35.715317Z",
"url": "https://files.pythonhosted.org/packages/b0/c6/57e64aa7f13e046e9b38897ae743930d455ad40625df25bcd0f3c8d4b5f0/pymongo-migrate-1.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-06-30 07:55:35",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "stxnext",
"github_project": "pymongo-migrate",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "pymongo-migrate"
}