{ "info": { "author": "Alex Radu", "author_email": "alex.radu.1000@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Database", "Topic :: Software Development :: Build Tools", "Topic :: Software Development :: Version Control", "Topic :: Utilities" ], "description": "limigrations |pypi| |travis| |coverage| |landscape|\n===================================================\n.. |travis| image:: https://travis-ci.org/dragosthealex/limigrations.svg?branch=master\n :target: https://travis-ci.org/dragosthealex/limigrations.svg?branch=master\n :alt: Build Status\n.. |pypi| image:: https://badge.fury.io/py/limigrations.svg\n :target: https://pypi.python.org/pypi/limigrations\n :alt: PyPi Package\n.. |landscape| image:: https://landscape.io/github/dragosthealex/limigrations/master/landscape.svg?style=flat\n :target: https://landscape.io/github/dragosthealex/limigrations/master\n :alt: Code Health\n.. |coverage| image:: https://coveralls.io/repos/github/dragosthealex/limigrations/badge.svg?branch=master\n :target: https://coveralls.io/github/dragosthealex/limigrations?branch=master\n :alt: Test Coverage\n\n`Migrations `_\nare a type of version control for databases, used to keep track\nof the changes made, and to provide easy maintainability.\nIn case something goes wrong, 'rollback' can be run and it will\nrevert the database to the previous state.\n\n`limigrations `_ provides basic migrations functionality for\n`sqlite3 `_. It contains a method\nfor connecting to the database, and functions for migrate\nand rollback.\n\nGetting started\n***************\n\nA migration consist in a Python script (preferably named by datetime of creation)\nplaced in the *migrations directory*.\nThe script should contain an import and a class called ``Migration`` which implements ``BaseMigration``.\n::\n\n from limigrations.migration import BaseMigration\n\n class Migration(BaseMigration):\n def up(self, conn, c):\n pass\n def down(self, conn, c):\n pass\n\nThere is an example `here `_.\n\nInstalation\n^^^^^^^^^^^^^^^^^^^^^\nInstall the package with `pip`\n::\n\n $ pip install limigrations\n\nor clone this repository and install\n::\n\n $ git clone git@github.com:dragosthealex/limigrations.git\n $ python setup.py install\n\nUsage\n^^^^^^^^^^^^^^^^^^^^^\n\n1. In your project create a directory for migrations\n::\n\n $ mkdir my-migrations\n\n2. Decide on a name for your database e.g. *my-database.db*\n::\n\n $ touch my-database.db\n\n3. Create your first migration using the command-line, then edit the `up` and `down` methods\n::\n\n $ python -m limigrations new --new_migration \"users_table\" --migrations_dir \"my-migrations\"\n\nOptionally, you can copy the `example `_\nand modifying the `up` and `down` methods, saving it in your migrations directory.\nIt's recommended to name it after the date and time e.g. *2017-03-08_12:31*\n\nCommand-Line\n\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\n4a. Run\n::\n\n $ python -m limigrations migrate --db_file \"my-database.db\" --migrations_dir \"my-migrations\"\n\n5a. Done! You should now see the changes written in the `up` method being applied.\n\n6a. If something goes wrong and you want to revert, run\n::\n\n $ python -m limigrations rollback --db_file \"my-database.db\" --migrations_dir \"my-migrations\"\n\n7a. You should see the changes written in the `down` method being applied.\n\nOptions\n~~~~~~~~~~~~~~~~\nThe following options can be used:\n::\n\n $ python -m limigrations -h\n\n usage: limigrations.py [-h] [-d DB_FILE] [-m MIGRATIONS_DIR] [-v] action\n\n positional arguments:\n action Action to take, can be 'migrate' or 'rollback'\n\n optional arguments:\n -h, --help show this help message and exit\n -d DB_FILE, --db_file DB_FILE\n Path to the database file.\n -m MIGRATIONS_DIR, --migrations_dir MIGRATIONS_DIR\n Path to the migrations directory.\n -v, --verbose Verbose\n\nRuntime\n\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\n4b. Import the limigrations module and run the migrations\n::\n\n from limigrations import limigrations\n\n limigrations.migrate('my-database.db', 'my-migrations')\n\n5a. If you want to rollback later, run the rollback\n::\n\n limigrations.rollback('my-database.db', 'my-migrations')\n\n6a. If you just want to connect to the database\n::\n\n conn, c = limigrations.connect_database('my-database.db')\n\nTesting\n***************\nAfter cloning the repository, run\n::\n\n python -m unittest -v tests.test_limigrations\n\nThere are two tests, one for `migrate` and one for `rollback`.\nThey create a test migration at runtime, defining the `up` and `down` methods,\nand then call the tested functions. The tests should leave no trace, as the\ndirectories and files are deleted after completion.\n\nContributing\n***************\n1. Fork the `repository `_ on GitHub.\n2. Make a branch off of master and commit your changes to it.\n3. Run the tests with ``unittest``\n4. Ensure that your name is added to the end of the AUTHORS file using the\n format ``Name (url)``, where the ``(url)`` portion is\n optional.\n5. Submit a Pull Request to the master branch on GitHub.\n\nIf you'd like to have a development environment, you should create a\nvirtualenv and then do ``pip install -e .`` from within the directory.\n\nAuthors\n***************\nAlex Radu - *initial work* - `www.alexdradu.com `_\n\nLicense\n***************\nThis project is licensed under the MIT License - see the `LICENSE.md `_ file for details.", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/dragosthealex/limigrations", "keywords": "migrations sqlite3 database development verson-control", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "limigrations", "package_url": "https://pypi.org/project/limigrations/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/limigrations/", "project_urls": { "Homepage": "https://github.com/dragosthealex/limigrations" }, "release_url": "https://pypi.org/project/limigrations/1.1.0/", "requires_dist": null, "requires_python": "", "summary": "Lightweight migrations system for python / sqlite3", "version": "1.1.0" }, "last_serial": 2719043, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "c403a697d559d943a5491afd3cdfe7f0", "sha256": "abe639ca03b302a09aa6a8d6c6c0fa919c528d36c915f828042933f729a2c050" }, "downloads": -1, "filename": "limigrations-1.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "c403a697d559d943a5491afd3cdfe7f0", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5242, "upload_time": "2017-03-08T13:39:26", "url": "https://files.pythonhosted.org/packages/86/5d/62cae00d8ada793e639d531adad58fc849872272ca968772b49241a69914/limigrations-1.0.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "627cfb67a4a4523865937d4278857547", "sha256": "bdc0a60026e56fa90ccf73844c30c7cba05be257676baa49ece89ac78c61e76a" }, "downloads": -1, "filename": "limigrations-1.0.0.tar.gz", "has_sig": false, "md5_digest": "627cfb67a4a4523865937d4278857547", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5976, "upload_time": "2017-03-08T13:39:28", "url": "https://files.pythonhosted.org/packages/77/5e/fc5d08d98ac51e11e9eaf40b05ad29e46d82ef4bc8e14dfb6f19c199c360/limigrations-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "c64abf0be6794f7634b58e63e1e61be5", "sha256": "a083268f01e090cb5490349e17b60da24aba540f77fbc63edadabdaec57e7bd6" }, "downloads": -1, "filename": "limigrations-1.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "c64abf0be6794f7634b58e63e1e61be5", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 9235, "upload_time": "2017-03-08T19:11:23", "url": "https://files.pythonhosted.org/packages/f3/fd/a1788b35364ecf7226e26b13fc99965fb5721f4b819f1ee2f21a09301b85/limigrations-1.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5510ed7b39724a25cdb9651e827cd4e8", "sha256": "7169f67bc7fc5047b1d6a371871617b34bc6079a1afa32233ef5beb42ce45ddf" }, "downloads": -1, "filename": "limigrations-1.0.1.tar.gz", "has_sig": false, "md5_digest": "5510ed7b39724a25cdb9651e827cd4e8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6667, "upload_time": "2017-03-08T19:11:25", "url": "https://files.pythonhosted.org/packages/b2/9f/6055ef6807ed42f5ab73d5965c0e71eb458e1b11228bb9d0768e6919857b/limigrations-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "0da0b620d631189b0bf47b81fefe08d8", "sha256": "0b700a3078337eb903fbb028f8b8b5e12337aa0404654ec48c328e1de1e607ed" }, "downloads": -1, "filename": "limigrations-1.0.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "0da0b620d631189b0bf47b81fefe08d8", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 9247, "upload_time": "2017-03-08T19:27:09", "url": "https://files.pythonhosted.org/packages/db/0e/e8e5b3797b78f17e8622ade45111a4fd15a47edb60f637a61b6716067ff6/limigrations-1.0.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f5f98a3e6ffc316d1c60b2a19f0c65d4", "sha256": "e31d58523172c6c1b9e3ac8357e8ce6d940e96181358f7835de1c8cafdf7be8d" }, "downloads": -1, "filename": "limigrations-1.0.2.tar.gz", "has_sig": false, "md5_digest": "f5f98a3e6ffc316d1c60b2a19f0c65d4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6682, "upload_time": "2017-03-08T19:27:10", "url": "https://files.pythonhosted.org/packages/b1/25/1acab25b176347153e40fe57a24255b38d6f325b85cb15ec3a70c0144982/limigrations-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "8e374ea20861ec3be56439120728bfdf", "sha256": "1bb91a5f229b550308696b71c4e83ef9230bc5a1fcb08cebd75f3053402ac948" }, "downloads": -1, "filename": "limigrations-1.0.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "8e374ea20861ec3be56439120728bfdf", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 9401, "upload_time": "2017-03-09T18:58:09", "url": "https://files.pythonhosted.org/packages/9b/88/8f5b984c36cefa71a3acf64d6063bc13ed50570b143b2ee175f68279d157/limigrations-1.0.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3e1a0b3b2467bf420d26ea2b485bf649", "sha256": "4fd3db883bacf6f1c5dc5180fcb539d46ede4b89e084e898c2ed5440088ebd7d" }, "downloads": -1, "filename": "limigrations-1.0.3.tar.gz", "has_sig": false, "md5_digest": "3e1a0b3b2467bf420d26ea2b485bf649", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6764, "upload_time": "2017-03-09T18:58:11", "url": "https://files.pythonhosted.org/packages/0f/1f/5b734125dfffa3b1836dcad626c0d29ad8b1ab3d5835123684142e7125ac/limigrations-1.0.3.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "13b0ba1da54f5a84853750ac8724f302", "sha256": "ce1d4ec808d623757f9b5692dedf44a4591fffcc9c89d07d320e203e6df9eda1" }, "downloads": -1, "filename": "limigrations-1.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "13b0ba1da54f5a84853750ac8724f302", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10475, "upload_time": "2017-03-20T22:58:12", "url": "https://files.pythonhosted.org/packages/1c/a9/6ac4ec1ba31f8b5de2d7b30cfb468990e424692d8ef7288b9ebae17f7a15/limigrations-1.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "20fd3a5427da33ed6e84d6f99cebe55c", "sha256": "4990f713f10a02c54266240d4c9eb76cb5cbb2fe01e203580cafc4e927a7db76" }, "downloads": -1, "filename": "limigrations-1.1.0.tar.gz", "has_sig": false, "md5_digest": "20fd3a5427da33ed6e84d6f99cebe55c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7624, "upload_time": "2017-03-20T22:58:15", "url": "https://files.pythonhosted.org/packages/85/2f/7348a87ecae3979946da6cf6d046a429f26fd5eed31a2eb3f5b250007ccc/limigrations-1.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "13b0ba1da54f5a84853750ac8724f302", "sha256": "ce1d4ec808d623757f9b5692dedf44a4591fffcc9c89d07d320e203e6df9eda1" }, "downloads": -1, "filename": "limigrations-1.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "13b0ba1da54f5a84853750ac8724f302", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10475, "upload_time": "2017-03-20T22:58:12", "url": "https://files.pythonhosted.org/packages/1c/a9/6ac4ec1ba31f8b5de2d7b30cfb468990e424692d8ef7288b9ebae17f7a15/limigrations-1.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "20fd3a5427da33ed6e84d6f99cebe55c", "sha256": "4990f713f10a02c54266240d4c9eb76cb5cbb2fe01e203580cafc4e927a7db76" }, "downloads": -1, "filename": "limigrations-1.1.0.tar.gz", "has_sig": false, "md5_digest": "20fd3a5427da33ed6e84d6f99cebe55c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7624, "upload_time": "2017-03-20T22:58:15", "url": "https://files.pythonhosted.org/packages/85/2f/7348a87ecae3979946da6cf6d046a429f26fd5eed31a2eb3f5b250007ccc/limigrations-1.1.0.tar.gz" } ] }