{ "info": { "author": "Mikko Hellsing", "author_email": "mikko@aino.se", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Database", "Topic :: Software Development :: Version Control" ], "description": "==============\naino-mutations\n==============\n\naino-mutations is a tool to call mutation scripts at a certain revision\nof a mercurial repository. Mutation scripts are typically scripts that perform\ndatabase refactoring of some sort. aino-convert is not intelligent:\n\n- Does not offer introspection\n\n- Mutation scripts are intended to use raw sql for schema migration\n which means you will be locked to a particular database engine, that of\n your own choice of course.\n\n\nWhy?\n----\naino-mutations solves the problem of running a mutation in the correct\nenvironment. Often when you do mutations you want to perform some logic\nto insert or remove data. To perform this logic we need the environment\nin which the mutation was written for. aino-convert automatically updates\na mercurial repository to the revision where the mutation was added and\nexecutes the mutation script.\n\n\nRequirements\n------------\n\n- Django with Multi DB support, v1.2+, or trunk until released.\n\n- Mercurial, only tested with v1.5\n\n- Django project managed by a mercurial repository\n\n\nInstallation\n------------\n\n1. Add ``mutations`` to your pythonpath\n\n2. Add ``mutations`` to ``INSTALLED_APPS``\n\n\nConfiguration\n-------------\nMutation scripts are by default looked for in a ``mutations`` subdirectory of\nyour mercurial repository root, you can change this by setting ``MUTATIONS_ROOT``\nin your settings file. Note that ``MUTATIONS_ROOT`` should be a relative\ndirectory path to your repository root.\n\n\nUsage\n-----\naino-mutations seperates mutations for different databases and therefore\nyou need to specify what database you are affecting with your mutation.\nTo add a mutation:\n\n1. Add the python file (mutation) to ``MUTATIONS_ROOT/alias/``\n where ``alias`` is the alias used in your settings file\n (the default is called ``default``).\n\n2. Add the file to the repository: ``hg add path/to/mutation``\n\n3. Commit: ``hg ci -m\"my first mutation\"``\n\n4. Now run the mutation: ``python manage.py mutate``\n\n\nMutations\n---------\nMutations are just normal python files that do whatever you like.\nFor convenience there are some local variables passed to the mutation scripts:\n\n- ``cursor``: a cursor instance for the current database\n\n- ``commit_unless_managed`` is just a shortcut for\n ``django.db.transaction.commit_unless_managed``\n\n- ``dry``: this will be True if ``mutate`` is run with the ``--dry`` option\n which can be usefull for displaying some info to the user.\n\n\nFAQ\n---\n\n- *I created a mutation that was wrong, what do I do?*\n- All you need to do is to remove it from the repository:\n ``hg rm path/to/mutation; hg ci -m\"no more bad code\"``\n\n\n- *I want to try a mutation before commiting, how can i do that?*\n- run: ``python manage.py runmutation path/to/mutation``\n\n\n- *I have my django project in a deployment environment, can I still use\n aino-mutations?*\n- The best way to solve this since aino-mutations may update project\n files to a certain revision while performing the mutations it is best to\n clone the repository to another location while accessing the same databases.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://bitbucket.org/aino/aino-mutations/", "keywords": null, "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "aino-mutations", "package_url": "https://pypi.org/project/aino-mutations/", "platform": "any", "project_url": "https://pypi.org/project/aino-mutations/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://bitbucket.org/aino/aino-mutations/" }, "release_url": "https://pypi.org/project/aino-mutations/0.1.0.0/", "requires_dist": null, "requires_python": null, "summary": "Mutating for evolution using Django and Mercurial", "version": "0.1.0.0" }, "last_serial": 4528461, "releases": { "0.1.0.0": [ { "comment_text": "", "digests": { "md5": "1a326724de33e052c336c7c0463bf265", "sha256": "946559acaac97db3878cc504a2bb6e9970f9012753779d97f6bf42d8e2e011eb" }, "downloads": -1, "filename": "aino-mutations-0.1.0.0.tar.gz", "has_sig": false, "md5_digest": "1a326724de33e052c336c7c0463bf265", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6128, "upload_time": "2010-04-06T01:59:46", "url": "https://files.pythonhosted.org/packages/e8/af/87b880b131fe79759975a3da0c3070c8e0c549c4d09e280fb490050a5e6c/aino-mutations-0.1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1a326724de33e052c336c7c0463bf265", "sha256": "946559acaac97db3878cc504a2bb6e9970f9012753779d97f6bf42d8e2e011eb" }, "downloads": -1, "filename": "aino-mutations-0.1.0.0.tar.gz", "has_sig": false, "md5_digest": "1a326724de33e052c336c7c0463bf265", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6128, "upload_time": "2010-04-06T01:59:46", "url": "https://files.pythonhosted.org/packages/e8/af/87b880b131fe79759975a3da0c3070c8e0c549c4d09e280fb490050a5e6c/aino-mutations-0.1.0.0.tar.gz" } ] }