summaryrefslogtreecommitdiff
path: root/migrate/versioning
Commit message (Collapse)AuthorAgeFilesLines
* Retire github mirror, repo moved to opendevHEADmasterJim Rollenhagen2019-09-2637-2939/+0
|
* Merge "Raise VersionNotFoundError instead of KeyError"Jenkins2016-06-031-3/+14
|\
| * Raise VersionNotFoundError instead of KeyErrordineshbhor2016-05-271-3/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently migrate.versioning.api.upgrade() raises KeyError instead of sqlalchemy-migrate specific exception if migration script file is not present in migration repository. Raised migrate.exception.VersionNotFoundError if the specified migration script does not exist in the repository. Made VersionNotFoundError exception class as a subclass of KeyError in order to avoid breaking existing users looking for KeyError. Related-Bug: #1546441 Change-Id: I0210d56a6e85f03c44cea027f50863faaf050c1d
* | Fix DeprecationWarning on setuptools >= 11.3dineshbhor2016-05-261-1/+8
|/ | | | | | | | | | | | Python 3.4 unit test is failing because of DeprecationWarning: Parameters to load are deprecated. Called .resolve and .require separately on setuptools >= 11.3. Made provision to call .resolve() method if setuptools >= 10.2 and less than 11.3 else call .load() method. Change-Id: I5ba80edfbf6b7c8399c66f01d57c91bd02eab274 Closes-Bug: #1586060
* Merge "Add VerNum.__index__() for Python 3 support"Jenkins2015-07-311-0/+3
|\
| * Add VerNum.__index__() for Python 3 supportVictor Stinner2015-07-281-0/+3
| | | | | | | | | | | | | | | | | | | | On Python 3, some functions like range() don't try to call the __int__() method to cast an object to integer, but try instead the __index__() method. Add an __index__() method to mimick correctly the int type on Python 3. Change-Id: I8df116d80e201778714a59367600eaef644266ed
* | Fixes usage function for Py3Thomas Goirand2015-07-221-7/+3
|/ | | | | | | | The usage function of migrate_repository.py isn't Python 3 compatible, and this hasn't be caught by unit tests. This patch fixes the function, so at least the file can be compiled in Py3. Change-Id: Ib9333e46e7526e82acde573d4b2046b2bf9a7ae0
* Unblock migrate (py26 and py3* testing issues)Matt Riedemann2015-07-181-10/+22
| | | | | | | | | | | | | | | | | | | | | | | | There are two changes which have to go together to pass the gate tests: 1. Update pbr and mock requirements from global-requirements mock 1.2 supports py26 again so make that the minimum version. The same change is being made in g-r with: Ic6b9e18eaec9c81bbbbc57129e024904be928e09 Sync up with latest pbr in global-requirements while we're at it. Closes-Bug: #1474925 2. Fix the importpath module to work with python >= 3.3 where the __import__ built-in is raising an ImportError on a temporary file that is added to the system path. Closes-Bug: #1475339 Change-Id: Ie98938ba75f3983094dd540b7d26a7ec46be4f6e
* Update flake8 related dependenciesMatt Riedemann2015-07-053-3/+3
| | | | | | | | | | | In order to raise the cap on pbr we need to update the dependent versions of the flake8 related packages for the pep8 job since they have capped pbr. A couple of simple hacking issues are fixed, the rest are ignored. Change-Id: Icddb5bf284da7b6463ebcfc7512726149ffe6085
* Merge "script: strip comments in SQL statements"Jenkins2015-02-241-0/+1
|\
| * script: strip comments in SQL statementsIhar Hrachyshka2015-01-141-0/+1
| | | | | | | | | | | | | | | | | | Regular expression does not match correctly against statements that contain comments at their start. So strip those comments first (and whitespaces, while we are at it). Change-Id: Iad9b544bf995374d76cab1e125658aae2f8511f4 Closes-Bug: #1410494
* | Merge "Fixes the auto-generated manage.py"Jenkins2015-01-152-0/+2
|\ \ | |/ |/|
| * Fixes the auto-generated manage.pyPeter Conerly2014-08-022-0/+2
| | | | | | | | | | | | | | | | Removes `six` from the locals().copy() so that it won't be templated into manage.py. Currently manage.py is mis-templated and is failing. Change-Id: Ib3b7c7caac998fbaa45c3370547c9b8bf13abe41 Closes-Bug: 171
* | Ignore transaction management statements in SQL scriptsIhar Hrachyshka2015-01-091-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that we don't run SQL script with a single .execute() call, transaction management statements (BEGIN, COMMIT, END) fail with operational error. Ignore them if occurred in a script. All in all, transactions are managed by SQLAlchemy-migrate itself, so there is no reason for the calling code to pass those statements in a SQL script. Warn user about the statements that are ignored. The ideal response to such a warning from library users is removing those redundant transaction management statements from their scripts. Note: ROLLBACK is not ignored even though it's one of transaction management statements because its usage in migration scripts is insane anyway, and we're better fail on it and not (almost) silently ignore it. Change-Id: Ie4179c0e9341d42656d66821aaac23f8dcd33927 Closes-bug: 1368391
* | SqlScript: execute multiple statements one by one0.9.2Ihar Hrachyshka2014-08-231-8/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some drivers [f.e. MySQL Connector] do not like multiple statements being passed to .execute(). They require either passing multi=True parameter to .execute() that is not DB-API 2.0 defined, or executing those statements one by one. For that patch, I've chosen the second option to stay away from driver specific hacks. Also removed SQLite hack that seems to be related to the same multiple statements issue. blueprint enable-mysql-connector Change-Id: Ic6d53ed1fef8aee9471f3540f06b39cd5ee4ef82
* | Make sure we don't throw away exception on SQL script failureIhar Hrachyshka2014-08-231-1/+2
|/ | | | | | | | | If SQL script failed, we don't currently log the failure anywhere, so users have hard time debugging an issue, if anything arises. Let's log the failure before proceeding with rollback. Change-Id: Ic92b1403c00bb238a68265a15150a4be6f6b2346
* Port to Python3Cyril Roelandt2014-04-0912-29/+55
| | | | | | | | | | | | | | | | | | Brief summary of the modifications: * Use six for compatibility with both Python 2 and 3; * Replace UserDict.DictMixin with collections.MutableMapping; * Fix relative imports; * Use test-requirements.txt for requirements that are common to both Python 2 and 3, and test-requirements-py{2,3}.txt for version-specific requirements; * Miscellaneous fixes. * Use a specific test_db_py3.cfg file for Python 3, that only runs tests on sqlite. Thanks to Victor Stinner who co-wrote this patch. Change-Id: Ia6dc536c39d274924c21fd5bb619e8e5721e04c4 Co-Authored-By: Victor Stinner <victor.stinner@enovance.com>
* Merge "Eradicate trailing whitespace"Jenkins2014-03-2910-34/+34
|\
| * Eradicate trailing whitespaceDavid Ripton2014-02-2610-34/+34
| | | | | | | | | | | | | | | | | | | | Remove all trailing spaces and tabs in every file in the project. People have editors configured to do this, which causes them to accidentally make little whitespace changes in unrelated commits, which makes those commits harder to review. Better to fix them all at once. Change-Id: I17d89f55f41d8599e0ab1a31f646cd161289703e
* | Fix genmodel for SQLA 0.9Thomas Goirand2014-03-051-10/+27
|/ | | | | | | | | | | | | | | | | | | | | | | | | | Problem: * Some python code was auto generated and exec'ed in that package. * The python code that was problematic had a 'Table' definition * The generated code imports '*' from sqlalchemy * One among the 'Column' was defined as an 'INTEGER' type, which points to sqlalchemy.sql.sqltypes.INTEGER * The INTEGER class was initialised with a parameter display_width which contradicts with sqlalchemy.sql.sqltypes.INTEGER.__init__, which does not accept any parameters * The 'INTEGER' class should have been imported from mysql dialects' type module Solution: * While generating, in the header part, I am now checking if any of the column.type.__class__.__name__ has 'dialects' in it. * If I find any, I am adding the import rule such that the type is imported from the dialects' type. This patch has been tested with SQLA 0.9.3, for which it fixes the unit tests, and with SQLA 0.8.2, which doesn't have (new) problems with this patch. Change-Id: Ie0e09b45388462629100017bea3ea8a314d148d8
* Add DB2 10.5 SupportMatt Riedemann2014-02-171-1/+11
| | | | | | | | | | | | | | | | | | This patch adds the initial support for DB2 10.5 to migrate. It includes: 1. The dialect implementation for DB2. 2. The dialect registration with the visitor. 3. Code to parse the engine name in version.py. 4. A new dependency on ibm_db_sa in test-requirements.txt. 5. A connection string in test_db.cfg for ibm_db_sa. Part of blueprint add-db2-support Co-authored-by: Sheng Bo Hou <sbhou@cn.ibm.com> Co-authored-by: Thuy Christenson <thuy@us.ibm.com> Co-authored-by: Rahul Priyadarshi <rahul.priyadarshi@in.ibm.com> Change-Id: I745ec615487b1b06c5d1a09ea316f376d66ee4c0
* Fix int overflow exception in unittest0.8Matt Riedemann2013-11-061-2/+17
| | | | | | | | | | | | | | | | | | Fixes: File ".../versioning/version.py", line 30, in __init__ if self < 0: OverflowError: Python int too large to convert to C long Don't use __cmp__ which is deprecated and restricted to C long ints, rather than python's arbitrary precision ints. Copied from Pádraig Brady's Fedora patch: http://pkgs.fedoraproject.org/cgit/python-migrate.git/commit/?id=a01bf449 Co-authored-by: Pádraig Brady <pbrady@redhat.com> Change-Id: I71f349f97507525b2f2edaf034005d67b6cc3987
* fix deprecation warning by using MetaData.reflectJan Dittberner2013-02-091-1/+2
|
* Import correct exceptions module (Fixes issue 154).Alex Favaro2013-02-091-1/+1
|
* apply patch for issue #72 by asuffield@gmail.comasuffield@gmail.com2012-01-231-1/+1
| | | fixes #72
* Fix excludeTablesgetDiffOfModelAgainstModel is not passingJason Michalski2011-12-171-1/+1
| | | | | excludeTables correctly Fixes issue 140
* PEP-8 compliant script templatesJan Dittberner2011-10-292-4/+8
|
* fix issues with ConfigParser and existing repositories (fixes issue 115)Jan Dittberner2011-10-284-7/+10
|
* remove obsolete manage.py_tmpl (related to issue 121)Jan Dittberner2011-10-282-6/+0
|
* generate if __name__ == "__main__" in manage.py (fixes issue 121)Jan Dittberner2011-10-282-2/+5
|
* merge fixes by wyenhoJan Dittberner2011-10-281-2/+3
|\
| * fixed issue 129wyuenho@gmail.com2011-10-021-1/+1
| |
| * fixed issue 83wyuenho@gmail.com2011-10-021-1/+2
| |
* | remove unused importDustin J. Mitchell2011-07-101-1/+0
| |
* | Fix issue 124: ignore sqlite_sequence in comparing db to modelDustin J. Mitchell2011-07-101-2/+10
|/
* Use two models in generated migrations. Test column addition and removal.Gabriel2011-07-071-33/+48
|
* Put constraints (positional) before args (keywords).Gabriel2011-07-051-1/+1
|
* Fix and test issue 118. Clarify genmodel transformations.Gabriel2011-07-054-60/+83
|
* Fix column creation in make_update_script_for_model.Gabriel2011-07-041-15/+14
| | | | | | | | | | Generating the script needs internal API updates: https://code.google.com/p/sqlalchemy-migrate/issues/detail?id=113 Getting the script to run needs the new columns defined: https://code.google.com/p/sqlalchemy-migrate/issues/detail?id=123 Table metadata represents the former state and does not contain the columns being added.
* More concise declarative output.Gabriel2011-06-291-18/+11
| | | https://code.google.com/p/sqlalchemy-migrate/issues/detail?id=122
* More pep8 compliant declarative output.Gabriel2011-06-291-7/+8
| | | https://code.google.com/p/sqlalchemy-migrate/issues/detail?id=122
* Fix some tests that broke when adding descriptions for sql scriptsPete Keen2011-06-121-1/+4
|
* Allow descriptions in sql change script filenamesPete Keen2011-06-103-15/+28
|
* Optionally number versions with timestamps instead of sequencesPete Keen2011-06-103-2/+27
|
* use DatabaseError instead of ProgrammingError because behaviour seems to be ↵Jan Dittberner2011-05-251-1/+1
| | | | database dependent (addresses issue 122)
* table.drop() raises ProgrammingError in SQLAlchemy 0.7 instead of SQLError ↵Jan Dittberner2011-05-251-4/+11
| | | | (addresses #112)
* fix py2.4 and py2.5Domen Kožar2011-02-051-1/+1
|
* fixes #107Domen Kožar2011-02-051-4/+4
|
* fixes #106Domen Kožar2011-02-051-6/+7
|
* fixes #105iElectric2010-12-061-1/+1
|