{ "info": { "author": "Andriy Maletsky", "author_email": "andriy.maletsky@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3.5", "Topic :: Software Development :: Version Control" ], "description": "Migrations\n==========\n\n.. image:: https://img.shields.io/pypi/v/migrations.svg?maxAge=2592000\n :target: https://pypi.python.org/pypi/migrations\n\nSimple, database-agnostic migration tool for Python applications.\nInspired by `node migrations `_.\n\nStatus\n------\nThe project is in beta now. Bugs and breaking changes may occur.\n\nFeatures\n--------\n+ No specific database requirements, use it for anything you call database.\n+ Pretty simple, just generate migration script and define self-explanatory\n ``up()`` and ``down()`` functions there.\n+ Use imports in your migration scripts to load database bindings. Talk to the\n database the same way your application does.\n+ Stores the sequence of already performed migrations. If the sequence does not\n match scripts in migrations directory (e.g. after merge), aborts and warns user.\n+ *TBD: Deeply configurable, including resources acquiring and releasing.*\n\nRequirements\n------------\nOnly Python 3 is supported for now.\n\nInstallation\n------------\n.. code-block:: bash\n\n $ pip install migrations\n\nNotice, this distribution provides package and executable\nscript named ``migrate``, so check if it does not mess with\nexisting packages/scripts. Generally, you should neither install\nthis tool globally, nor install several migration tools for one project.\n\nUsage\n-----\n.. code-block::\n\n usage: migrate [options] [action]\n\n actions:\n up [-h] [NAME|COUNT] (default) perform COUNT migrations or till\n given NAME (by default perform all available)\n down [-h] [NAME|COUNT] revert COUNT migrations or till\n given NAME (by default revert one)\n create [-h] NAME create new migration file\n\n show [-h] print all migrations in chronological order\n\n options:\n -h, --help show this help message and exit\n -v, --version show version and exit\n -d PATH, --migrations-dir PATH\n directory where migrations are stored\n -s PATH, --state-file PATH\n location of file which stores database state\n -t PATH, --template-file PATH\n location of template file for new migrations\n\nEach migration file must define functions ``up()`` and ``down()``\nwithout required arguments.\n\nSimple migration example:\n\n.. code-block:: python\n\n import redis\n\n db = redis.Redis(host='localhost', port=6379)\n\n def up():\n db.rpush('used_libraries', 'migrations')\n\n def down():\n db.rpop('used_libraries', 'migrations')\n\nCurrent working directory is prepended to ``sys.path``, so any\n``import`` statement in migration file tries to find requested\nmodule in working directory at first. You can use this to manage\ndatabase access for your both app and migrations with single piece\nof code. See an example. Let's assume that in working directory\nwe have module named ``db``, which contains singleton object\nresponsible for DB connection, for example\n`PyMySQL `_ Connection object.\n\n.. code-block:: python\n\n from db import connection\n\n def manage_cursor(action):\n def wrap():\n with connection.cursor() as cursor:\n action(cursor)\n connection.commit()\n return wrap\n\n @manage_cursor\n def up(cursor):\n cursor.execute(\n \"INSERT INTO used_libraries (`name`) VALUES ('migrations')\"\n )\n\n @manage_cursor\n def down(cursor):\n cursor.execute(\n \"DELETE FROM used_libraries WHERE `name`='migrations'\"\n )", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/and800/migrations", "keywords": "migration", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "migrations", "package_url": "https://pypi.org/project/migrations/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/migrations/", "project_urls": { "Homepage": "https://github.com/and800/migrations" }, "release_url": "https://pypi.org/project/migrations/0.1.1/", "requires_dist": null, "requires_python": "", "summary": "Yet another Python migration tool", "version": "0.1.1" }, "last_serial": 2434991, "releases": { "0.0.0": [ { "comment_text": "", "digests": { "md5": "9062083ae9f6d8f3aef1b018c897ef09", "sha256": "2af8b2589f2d1edb1213affa6d61e9c8e81ac21af76a3e1f886b81805532de8c" }, "downloads": -1, "filename": "migrations-0.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "9062083ae9f6d8f3aef1b018c897ef09", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5165, "upload_time": "2016-09-12T13:55:54", "url": "https://files.pythonhosted.org/packages/c7/26/f348d850402015385471a26550c8a8f2ad03f002b22e1d84d03ec93a8257/migrations-0.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "02b1597d3a0af65336d539f6de2b774d", "sha256": "fdce81dbeeeeef479315a4eee3433c0f5dbab93c0afad5f3259eb7b9f86c1a00" }, "downloads": -1, "filename": "migrations-0.0.0.tar.gz", "has_sig": false, "md5_digest": "02b1597d3a0af65336d539f6de2b774d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3201, "upload_time": "2016-09-12T13:55:56", "url": "https://files.pythonhosted.org/packages/42/8e/d111c1c86cb2fa26042d2e2d78270298f824af78fcd11c972d2bce36bc18/migrations-0.0.0.tar.gz" } ], "0.0.1": [ { "comment_text": "", "digests": { "md5": "a984821cc67f3442b25060bac8d070e2", "sha256": "baea376db0bb08bbdee899487be38af1deb68721cab3cc9c2e9f43296c7f62d1" }, "downloads": -1, "filename": "migrations-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "a984821cc67f3442b25060bac8d070e2", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7006, "upload_time": "2016-09-13T19:10:39", "url": "https://files.pythonhosted.org/packages/ab/9e/686c72b9f3cb4fd3f93f442c733463e250cfc0b210439651462a5d310dde/migrations-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "985fb3c0ae3d7cf80f12cc07a7e99a03", "sha256": "6b32ae0cf4f17ce927b44dc94e73899260ee757fd542090ac9155d841b46e8e8" }, "downloads": -1, "filename": "migrations-0.0.1.tar.gz", "has_sig": false, "md5_digest": "985fb3c0ae3d7cf80f12cc07a7e99a03", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4312, "upload_time": "2016-09-13T19:10:42", "url": "https://files.pythonhosted.org/packages/00/46/3d8f8dbcd251b54ad9a876fdc1566bf4a7a7d22aa4fef2b24529dad8f96a/migrations-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "2cf7901eaef89ac260509d2d931a8ee9", "sha256": "34c7c3f6d067e38d140bfbeaa2746944ca325dcfecde2dc5439af4d132511b59" }, "downloads": -1, "filename": "migrations-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "2cf7901eaef89ac260509d2d931a8ee9", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7167, "upload_time": "2016-09-24T22:22:27", "url": "https://files.pythonhosted.org/packages/79/77/9c021decebd86b722bb844325f7e0f5bd5c0e60be7b3a5f3e8b2566aeb20/migrations-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d4002c57492518e0b2f89fb3355c2112", "sha256": "e1eff942762b68feaf072ee36d971d95fb6d0540068970da51b95760b5288fa8" }, "downloads": -1, "filename": "migrations-0.0.2.tar.gz", "has_sig": false, "md5_digest": "d4002c57492518e0b2f89fb3355c2112", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4564, "upload_time": "2016-09-24T22:22:29", "url": "https://files.pythonhosted.org/packages/6d/8e/bdf86954f5ab588a9ff3ab57873d960a643923088ba57cb6b4768495ac4b/migrations-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "aa077f8488d5cb75e382e3de204165fd", "sha256": "b720a484187d26fdb2ac42f186e1e7c6ff38ae214f93cb5717108b9cefa94d3a" }, "downloads": -1, "filename": "migrations-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "aa077f8488d5cb75e382e3de204165fd", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7224, "upload_time": "2016-09-25T00:11:26", "url": "https://files.pythonhosted.org/packages/0e/4b/f47bdf20476ab1100d46991e5ae0552b528c4c67964000d7ceea515f52b4/migrations-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2942297d1563b5f65a13a263ad97bbde", "sha256": "606d7c44543065f5e3bbb9981765a842d0f2d9edc999c0fd26354f40e1fa7f08" }, "downloads": -1, "filename": "migrations-0.0.3.tar.gz", "has_sig": false, "md5_digest": "2942297d1563b5f65a13a263ad97bbde", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4620, "upload_time": "2016-09-25T00:11:28", "url": "https://files.pythonhosted.org/packages/ad/8a/9f9956fb8dfd61d2480ee1d3e3685c06364b914a5a3cd2d761ae31518944/migrations-0.0.3.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "d91fd14c01cb64593a2aab910bb2d3c3", "sha256": "f6b961060e48b34bf1c5480e1f00b2d79e4e9d1ecc4945e6f027f17dd6a33acf" }, "downloads": -1, "filename": "migrations-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "d91fd14c01cb64593a2aab910bb2d3c3", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8486, "upload_time": "2016-10-01T18:53:10", "url": "https://files.pythonhosted.org/packages/06/28/50ffcd59c2fd702862e7327a00a87b626a3be77a7c8941d76f1a8f333f02/migrations-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "02181604305ae8f375a9425fa969c6d8", "sha256": "340252aaba0d18099ad392ba10e7224881967f2ef1dea9e1074d127fdf2679a2" }, "downloads": -1, "filename": "migrations-0.1.0.tar.gz", "has_sig": false, "md5_digest": "02181604305ae8f375a9425fa969c6d8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5747, "upload_time": "2016-10-01T18:53:12", "url": "https://files.pythonhosted.org/packages/2f/d9/ea818dca5485803c4845e432262e5da418649ffbf7275d020b55162ebc27/migrations-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "8ea5a3b4c9df7b475c106d25065bc130", "sha256": "bc416fb8c608891ff2d9a48b221f542eb01d26469225aba86bf0641d331d4143" }, "downloads": -1, "filename": "migrations-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "8ea5a3b4c9df7b475c106d25065bc130", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9253, "upload_time": "2016-11-01T12:24:26", "url": "https://files.pythonhosted.org/packages/c2/8d/e165b6386736a1765f1a524e85a04d6b4f5edcee318f684f9aaaecf3060a/migrations-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5b3ad233bda26c4793b63ea7f8e25a31", "sha256": "f4ed223ffa2f6ed8df50b5058c49506ef34db30c81b2574be1d22b38a7f8c8ea" }, "downloads": -1, "filename": "migrations-0.1.1.tar.gz", "has_sig": false, "md5_digest": "5b3ad233bda26c4793b63ea7f8e25a31", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6163, "upload_time": "2016-11-01T12:24:29", "url": "https://files.pythonhosted.org/packages/1a/20/50022571c949dee64a8d0d2ef0e8d15c358cc9da6261d9819f07f16a726a/migrations-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8ea5a3b4c9df7b475c106d25065bc130", "sha256": "bc416fb8c608891ff2d9a48b221f542eb01d26469225aba86bf0641d331d4143" }, "downloads": -1, "filename": "migrations-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "8ea5a3b4c9df7b475c106d25065bc130", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9253, "upload_time": "2016-11-01T12:24:26", "url": "https://files.pythonhosted.org/packages/c2/8d/e165b6386736a1765f1a524e85a04d6b4f5edcee318f684f9aaaecf3060a/migrations-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5b3ad233bda26c4793b63ea7f8e25a31", "sha256": "f4ed223ffa2f6ed8df50b5058c49506ef34db30c81b2574be1d22b38a7f8c8ea" }, "downloads": -1, "filename": "migrations-0.1.1.tar.gz", "has_sig": false, "md5_digest": "5b3ad233bda26c4793b63ea7f8e25a31", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6163, "upload_time": "2016-11-01T12:24:29", "url": "https://files.pythonhosted.org/packages/1a/20/50022571c949dee64a8d0d2ef0e8d15c358cc9da6261d9819f07f16a726a/migrations-0.1.1.tar.gz" } ] }