6 Commits

Author SHA1 Message Date
Mike Bayer
fe64667106 Don't use deprecated / non-functional "force" parameter
The "force" parameter in SQLAlchemy IdentifierPreparer.quote()
has been a no-op since 0.9 in
031ef08078,
which was six years ago.   In SQLAlchemy 1.3 this parameter
will be removed entirely.   Bump requirements to 0.9 series
here and remove usage of the "force" flag.

Change-Id: I4492df2e7d2075fefbf13d6782de11f7d402f6b8
2019-01-18 13:11:40 -05:00
Qin Zhao
e57ee4c3a4 Fix ibmdb2 index name handling
The ibmdb2 code calls _index_identifier() when it handles index name. This
method only exists from sqlalchemy 0.6.5 to 0.7.*. Nova code change
https://review.openstack.org/#/c/153123/ attempts to drop a db constraint and
it fails to sync nova db with sqlalchemy 0.9.8 running against db2. Need to let
ibmdb2 code identify sqlalchemy version and call the correct method to handle
index name.

Closes-Bug: 1428477

Change-Id: Ie6333f9cea0209c1ea290356873a1a1bcf409bed
2015-03-16 15:21:03 +00:00
Rahul Priyadarshi
74553f426c Use native sqlalchemy 0.9 quote attribute with ibmdb2
Commit 8d6ce64cd08c0598963a92844495782997cd59f3 started using the native
quote attribute built into sqlalchemy 0.9 but missed the changes to the
ibmdb2 changeset, so alter table statements fail for DB2 on sqlalchemy
>= 0.9 (tested against 0.9.8).

This fixes the same issue for the ibmdb2 changeset.

Change-Id: Ia3fa6c3090b5eab29ed7746f4795d502990b8a2f
2015-01-09 14:31:28 -08:00
Matt Riedemann
7bb74f70e9 Fix ibmdb2 unique constraint handling for sqlalchemy 0.9
The ibmdb2 unique constraint code was accessing the private _all_cols
member var in iterating over columns which breaks in sqlalchemy 0.9 so
fix up the code to not use internals of sqlalchemy.

UniqueConstraint in sqlalchemy extends ColumnCollectionConstraint
which implements __iter__ to generate a tuple of the columns in
the constraint, so we just iterate over the constraint as the fix.

This is based on a patch from Rahul Priyadarshi in ibm-db-sa issue
158:

https://code.google.com/p/ibm-db/issues/detail?id=158

Co-Authored-By: Rahul Priyadarshi <rahul.priyadarshi@in.ibm.com>

Change-Id: I0f06f6314c382e83573d762abe5981db0a02a83a
2014-08-04 07:34:08 -07:00
David Ripton
6502d4017a Fix 3 files with Windows line endings to Unix line endings.
Change-Id: Iadc8e5d195bf998a117da4b7102a8955e238dd4e
2014-02-27 10:32:17 -05:00
Matt Riedemann
85317aead6 Add DB2 10.5 Support
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
2014-02-17 07:17:31 -08:00