{ "info": { "author": "Sebastian Rittau", "author_email": "srittau@rittau.biz", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Topic :: Database", "Topic :: Software Development" ], "description": "# dbupgrade\n\nDatabase Migration Tool\n\n[![MIT License](https://img.shields.io/pypi/l/dbupgrade.svg)](https://pypi.python.org/pypi/dbupgrade/)\n[![GitHub](https://img.shields.io/github/release/srittau/dbupgrade/all.svg)](https://github.com/srittau/dbupgrade/releases/)\n[![pypi](https://img.shields.io/pypi/v/dbupgrade.svg)](https://pypi.python.org/pypi/dbupgrade/)\n[![Travis CI](https://travis-ci.org/srittau/dbupgrade.svg?branch=master)](https://travis-ci.org/srittau/dbupgrade)\n\nUsage: `dbupgrade [OPTIONS] [-l API_LEVEL|-L] DBNAME SCHEMA DIRECTORY`\n\nUpgrade the given `SCHEMA` in the database specified as `DBNAME` with SQL\nscripts from `DIRECTORY`. `DIRECTORY` is searched for all files with the\n`.sql` suffix. These files are SQL scripts with a special header sections:\n\n```sql\n-- Schema: my-db-schema\n-- Version: 25\n-- API-Level: 3\n-- Dialect: postgres\n\nCREATE TABLE ...\n```\n\nThe following headers are required:\n\n* **Schema** \n Name of the schema to update.\n* **Dialect** \n Database dialect of this script. Use SQLalchemy's database\n URL scheme identifier, e.g. `postgres` or `sqlite`.\n* **Version** \n The new version of the schema after this script was applied.\n It is an error if two scripts have the same schema, dialect, and version.\n* **API-Level** \n The new API level of the schema after this script was applied.\n For a given schema, the API level of a subsequent version must either be\n equal or higher by one than the API level of the preceding version. For\n example, if script version 44 has API level 3, script version 45 must\n have API level 3 or 4.\n* **Transaction** *(optional)* \n Possible values are `yes` (default) and `no`. When this\n header is yes, all statements of a single upgrade file and the\n corresponding version upgrade statements are executed within a single\n transaction. Otherwise each statement is executed separately. The former\n is usually preferable so that all changes will be rolled back if a\n script fails to apply, but the latter is required in some cases.\n\nThe database must contain a table `db_config` with three columns: `schema`,\n`version`, and `api_level`. If this table does not exist, it is created.\nThis table must contain exactly one row for the given schema. If this row\ndoes not exist, it is created with version and api_level initially set to 0.\n\nThe current version and API level of the schema are requested from the\ndatabase and all scripts with a higher version number are applied, in order.\nIf there are any version numbers missing, the script will stop after the\nlast version before the missing version.\n\nUnless the `-l` or `-L` option is supplied, only scripts that do not\nincrease the API level will be applied. If the `-l` option is given, all\nscripts up to the given API level will be applied. `-L` will apply all\nscripts without regard to the API level.\n\nEach script is executed in a seperate transaction. If a script fails, all\nchanges in that script will be rolled back and the script will stop with\nan error message and a non-zero return status.\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/srittau/dbupgrade", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "dbupgrade", "package_url": "https://pypi.org/project/dbupgrade/", "platform": "", "project_url": "https://pypi.org/project/dbupgrade/", "project_urls": { "Homepage": "https://github.com/srittau/dbupgrade" }, "release_url": "https://pypi.org/project/dbupgrade/2.0.0/", "requires_dist": [ "sqlalchemy (>=1.0)", "sqlparse (>=0.3.0)" ], "requires_python": ">= 3.7", "summary": "Database Migration Tool", "version": "2.0.0" }, "last_serial": 5640730, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "62b26f0594957a39f99f49f68f9c97f3", "sha256": "1abe3c206bc342333864b8ad69c25d31bdc4e385d040f47b491d1c2c87ce143c" }, "downloads": -1, "filename": "dbupgrade-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "62b26f0594957a39f99f49f68f9c97f3", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 12272, "upload_time": "2018-02-14T11:09:34", "url": "https://files.pythonhosted.org/packages/f8/44/195640c5ecd443583897c51202739524656672ff2b27e3cf985aa5e7389a/dbupgrade-0.1.0-py3-none-any.whl" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "798cec6862c5d75f6ed6867b9b2ff41a", "sha256": "fb951e8838142d1ccd92d257b13a137d9883a26f32554a66c2af9dbde88c9c9c" }, "downloads": -1, "filename": "dbupgrade-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "798cec6862c5d75f6ed6867b9b2ff41a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 12855, "upload_time": "2018-02-14T12:11:04", "url": "https://files.pythonhosted.org/packages/28/a2/f1f14b5bc8060b9044e69d700e4cdc0c466b511c74ab2085895395ade00b/dbupgrade-0.2.0-py3-none-any.whl" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "23ee6223ee36a359626effb7ec09c3dd", "sha256": "7e81ed25fe1c7a944c925ff54fb1fd14cf4e5f710a1d84f955b7d21fcc8bc672" }, "downloads": -1, "filename": "dbupgrade-0.2.1-py3-none-any.whl", "has_sig": false, "md5_digest": "23ee6223ee36a359626effb7ec09c3dd", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 12895, "upload_time": "2018-02-22T11:36:33", "url": "https://files.pythonhosted.org/packages/0f/11/5b9d22eff652931022673e79f25c7ef8c6807d0d477835e1af852c23819e/dbupgrade-0.2.1-py3-none-any.whl" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "f300369f8227242fe8c459f30965dfb0", "sha256": "76f72d8c6fc4d4afdf270b4cfe561a8f5496ce841abe5b4ff0b8931f253e5514" }, "downloads": -1, "filename": "dbupgrade-0.2.2-py3-none-any.whl", "has_sig": false, "md5_digest": "f300369f8227242fe8c459f30965dfb0", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 10812, "upload_time": "2018-06-14T14:44:15", "url": "https://files.pythonhosted.org/packages/2d/48/12f686d2056f572029f02926e53a2e7c1fe9151ae430f0e9fadfdbdf8899/dbupgrade-0.2.2-py3-none-any.whl" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "6594a0eb79fe883da53c5213ad5f105c", "sha256": "2bd08c502d2dfd1112be395d6cc7d4f71bc939f45be46272a667bc4f72ae52b4" }, "downloads": -1, "filename": "dbupgrade-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "6594a0eb79fe883da53c5213ad5f105c", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">= 3.5, < 3.8", "size": 10924, "upload_time": "2018-07-16T11:26:35", "url": "https://files.pythonhosted.org/packages/74/25/1090fd5cb5b6466d581bada69051276584b0510830b41031ee363f65dcbb/dbupgrade-1.0.0-py3-none-any.whl" } ], "2.0.0": [ { "comment_text": "", "digests": { "md5": "047a1c1e021379dad54977c13b974eb3", "sha256": "bceb194928a8326c6c3ec22c4e2042a0bee4ea7e6c83f14dc87649fc2fe82289" }, "downloads": -1, "filename": "dbupgrade-2.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "047a1c1e021379dad54977c13b974eb3", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">= 3.7", "size": 11750, "upload_time": "2019-08-06T16:42:08", "url": "https://files.pythonhosted.org/packages/c3/ad/a7bc7dadb2cd452c64eb883d448729dad3cb1cafeb24f217d70be8fd6ddf/dbupgrade-2.0.0-py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "047a1c1e021379dad54977c13b974eb3", "sha256": "bceb194928a8326c6c3ec22c4e2042a0bee4ea7e6c83f14dc87649fc2fe82289" }, "downloads": -1, "filename": "dbupgrade-2.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "047a1c1e021379dad54977c13b974eb3", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">= 3.7", "size": 11750, "upload_time": "2019-08-06T16:42:08", "url": "https://files.pythonhosted.org/packages/c3/ad/a7bc7dadb2cd452c64eb883d448729dad3cb1cafeb24f217d70be8fd6ddf/dbupgrade-2.0.0-py3-none-any.whl" } ] }