AbstractType not longer exists in the class hierarchy for types.
TypeEngine was its direct descendant, so use that instead.
Change-Id: Idbfaee4b0d3acbc4795913ddf2ab4e1c9b6d065c
There's no script_path param in the current version of
scripttest. This patch fixes that by removing the param,
which by the way isn't useful.
Change-Id: Ic78cea25bb472702473e98b48a8ff74c01545aa3
In SQLA 0.9 there is now a native .quote attribute on many objects.
Conditionally use this instead of the old method if the attribute
exists, to remove deprecation messages (and prepare for when the
other way will be fully removed).
Change-Id: I3c5fada13e044c1c4102acc0455226ce1524f2e2
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
Since ibm_db_sa is not part of sqlalchemy, we need to handle the
conditional import of the module in visitor.py so we don't get an
ImportError if ibm_db_sa is not available.
Closes-Bug: #1287229
Change-Id: Ida070b629ce3b9be727ae49973bb6a71543c1dcf
The unit tests of subunit are failing with an older version of
subunit, so we need to fix the test-requirements.txt to reflect
the reality.
Change-Id: I786c70a02196b00fb0d96feb5fd1a0b5281f6672
This patch fixes get_constraint_name in the
ANSIConstraintCommon class. It's part of the
fixes needed for SQLA 0.9.x compat.
Change-Id: I1f1648af48f459bd18f99bb42fa9a272186fb37d
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
migrate can't just take a global requirements sync because it
needs to be tested against multiple versions of SQLA to assure
compatibility. A recent change had the effect of only testing
migrate against SQLA 0.7, which is definitely *not* what we
want to be doing.
this reverts that change, and leaves very specific comments to
hopefully prevent this from happening in the future.
Change-Id: Icb4e136f0de6caa224019bb955341c4b67c5e1a1
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
It was causing the release tarball to have an extra ".dev." in its filename,
which then broke the script that uploads the release to PyPI.
Change-Id: I995fb3e0393468568601e8614c0532b93fbe8ceb
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
Version 0.8 of SQLAlchemy added support of indexes
on expressions in addition to plain table columns,
which changed the way indexes are created.
This broke support of dropping columns of composite
indexes for SQLite: due to limitations of ALTER in
SQLite every time a column is dropped, we recreate
the whole table without the given column; if a
column is a part of a composite index, we change the
index definition to omit that column and then indexes
are recreated too.
SQLAlchemy versions starting from 0.8 no more pay
attention to 'columns' attribute of Index instances
when generating DDL for indexes, so when one of columns
of a composite index is dropped, we try to create a
new index on the column that doesn't exist anymore,
which of course fails.
Closes-Bug: #1241038
Change-Id: I777b8ce36e36f49bfb0889908811a063cf1a527b
In addition to running tests with different Python and SQLAlchemy
versions, they should also be run on different DB backends, which
are used in production (PostgreSQL and MySQL).
This patch:
- modifies test_db.cfg to run tests on PostgreSQL and MySQL
(Jenkins Slave credentials are used here, to ensure these
tests are always run by Jenkins gate); if a backend is not
available, test cases will be skipped for it
- concurrency is set to 1 (sharing of the one MySQL or PostgreSQL
DB among different test runner processes would lead to
race conditions)
- fixes tests dropping FK columns in MySQL: in earlier MySQL
versions dropping a column that is a part of a FK constraint
would lead to dropping of the FK too. As of MySQL 5.5 that's
not the case anymore: if one tries to drop such column, he/she
will get a very obscure error (something like "Error on rename
of './openstack_citest/#sql-4af_aa2' to './openstack_citest/tmp_adddropcol'
(errno: 150)") '\nALTER TABLE tmp_adddropcol DROP COLUMN r2').
So the solution if to drop FK constraints first, and only then
the columns it is made up of
Change-Id: I8c5d2874c83e7df46da69969ed54d85437c849e7
Update to needing 1.6, which gives us the ability to alter how the
software is installed into the virtualenv. It also brings in pip 1.4,
which lets us avoid getting pre-releases of things we weren't expecting.
Change-Id: I3189f06610d776a032b5f8bf0910f59e4ed45719
pbr updated itself to remove the d2to1 dependency. One of the main
reasons for this is a direct upstream dependency on distribute, which
causes the distribute/setuptools merge bug to get triggered, which
breaks people's system if they install with pip < 1.4.
Remove d2to1 references, and also bump the required version requested of
pbr to a version late enough to no longer depend on d2to1.
Remove the version specifier from setup.py, because setup_requires has
no way to trigger a version requirement upgrade. The flat version should
be sufficient for the setup.py interface in perpetuity.
Remove the setup-hook from setup.cfg, as it is no longer needed.
Change-Id: I40d3507c77802d13fd894aa16714b2ed6aa7d59f
In commit 0.7.2-16-gc670d1d the _index_identifier() implementation
was copied from sqlalchemy, as that function was renamed
in sqlalchemy 0.8. Instead handle call the renamed function
when appropriate, to decouple ourselves from the sqlalchemy
implementation.
Change-Id: I97b22c20d96758fc5b6bd55318218edb26c5b5d0
The test suite should be run for all possible combinations
of Python and SQLAlchemy versions we claim to support, which
are Python 2.6 and 2.7 and SQLAlchemy 0.7.x (old stable) and
0.8.x (mainline stable).
py26/py27 tox envs install the latest stable version of SQLAlchemy
(currently, 0.8.x branch), so two additional tox environments added
to run the test suite with SQLAlchemy 0.7.x (for both Python 2.6 and 2.7).
Change-Id: I50c7009d8b808ce3bbb1f0a27c50f5cb5116cdb3
pip versions >= 1.4 will not install pytz unless a minimum
version containing a letter is specified (this workaround is
taken from Babel Python library).
Change-Id: Ic013fca82816cd89e446282d3936e38ea2c39274
RTFD only has a single requirements field, so make one that installs the
total set of needed requirements to allow docs to build properly.
Change-Id: I79b8202a6a7944cec052a2431dff670258bf7171