435 Commits

Author SHA1 Message Date
Jenkins
e20068490b Merge "Eradicate trailing whitespace" 2014-03-29 18:27:33 +00:00
Sean Dague
0b08e91df2 turn on testing for sqla 0.9
this enables tox testing for the sqla 0.9 changes, and provides
new targets for sqla 0.9 and 0.8.

Change-Id: I297dce0267bd10cd7db0fe270945c8e5a3431167
0.9
2014-03-05 08:20:54 -05:00
Thomas Goirand
7161cf2c9e Replace AbstractType by TypeEngine
AbstractType not longer exists in the class  hierarchy for types.
TypeEngine was its direct descendant, so use that instead.

Change-Id: Idbfaee4b0d3acbc4795913ddf2ab4e1c9b6d065c
2014-03-05 08:20:54 -05:00
Thomas Goirand
b58b4a353c fix scripttest compat
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
2014-03-05 08:20:54 -05:00
Thomas Goirand
8d6ce64cd0 Use native quote attribute introduced in sqla 0.9
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
2014-03-05 08:20:49 -05:00
Thomas Goirand
bcb6991615 Fix genmodel for SQLA 0.9
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
2014-03-05 06:55:25 -05:00
Jenkins
0ffaaae935 Merge "UniqueConstraint named and escaped twice" 2014-03-05 08:46:17 +00:00
Jenkins
716124f2ad Merge "Conditionally import ibmdb2/ibm_db_sa" 2014-03-04 20:38:53 +00:00
Matt Riedemann
12a6bcfa8c Conditionally import ibmdb2/ibm_db_sa
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
2014-03-04 10:12:40 -08:00
Thomas Goirand
f944414bd4 migrate needs subunit >= 0.0.18
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
2014-03-02 15:18:31 +08:00
Thomas Goirand
98ae3ac832 UniqueConstraint named and escaped twice
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
2014-03-02 13:12:45 +08:00
David Ripton
d6fbf12989 Eradicate trailing whitespace
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
2014-02-26 15:04:54 -05:00
Jenkins
21fcdad0f4 Merge "Add DB2 10.5 Support" 0.8.4 0.8.3 2014-02-23 19:16:52 +00:00
Sean Dague
fe148d87b4 uncap SQLA in requirements.txt
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
0.8.5
2014-02-23 11:38:53 -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
Sascha Peilicke
d58e47f85c Sync with global requirements
Change-Id: If05a5d65558ca848b80c3f57c19cb5029adbe58a
2014-02-12 16:46:49 +01:00
Eric Harney
ce351c06be Fix broken development version link in README
Change-Id: Id9035c167d397cdad32d418c37108586344d8edc
2013-11-15 13:41:47 -05:00
Monty Taylor
928a846619 Un-break the version in migrate/__init__.py
Change-Id: Ie642315c20866435a709d576c99d6e293e7a7e63
0.8.2
2013-11-15 13:04:56 -05:00
Dan Prince
73df211afe Fix the version number to match the last release.
** NOTE: our release process really should do this
ahead of time.

Change-Id: Ic0cce0d57b4f05092417c4cf1a4ca5a74812ec3c
2013-11-15 12:09:52 -05:00
Jenkins
82f94dd116 Merge "Remove the tag_build line from setup.cfg" 0.8.1 2013-11-15 07:04:25 +00:00
David Ripton
fbc7ef03d1 Remove the tag_build line from setup.cfg
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
2013-11-14 14:55:10 -05:00
Sascha Peilicke
40624e7ddc Drop setuptools_git test requirement
We don't need this since we're using pbr.

Change-Id: I7c5985fac66d5e7a4fca1b3945a18a364a94e971
2013-11-14 13:40:12 +01:00
Matt Riedemann
c49b8beb83 Fix int overflow exception in unittest
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
0.8
2013-11-06 07:19:42 -08:00
Roman Podolyaka
2485118c24 Fix dropping of indexed columns in sqlite/sa08
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
2013-10-18 16:09:16 +03:00
Roman Podolyaka
a91766a1ac Run tests on PostgreSQL and MySQL too
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
2013-10-12 07:04:33 +00:00
Monty Taylor
838c1cbb14 Update tox requirements
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
2013-10-07 12:03:28 -04:00
Monty Taylor
2ac02e0ef5 Stop using the d2to1-based pbr
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
2013-10-07 12:02:24 -04:00
Pádraig Brady
5c646eb558 decouple index name generation from sqlalchemy version
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
2013-09-23 15:18:59 +01:00
Roman Podolyaka
ddea3a8bc8 Run tests with different SQLAlchemy versions
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
2013-08-05 10:40:55 +03:00
Roman Podolyaka
427149eef2 Add a workaround for pytz and pip>=1.4
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
2013-08-05 10:38:46 +03:00
Monty Taylor
b5d64cdbe4 Add a reqs files for RTFD
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
2013-07-12 10:53:37 -04:00
Pádraig Brady
74ccf7a397 Fix exceptions for SQLAlchemy 0.8
Change-Id: Ib541ac9d6b397300e34ca8b65aad459b612858c3
2013-07-11 22:01:32 -04:00
Josip Delic
c670d1d36a added bugfixes for 0.8 2013-07-11 17:07:04 -04:00
Monty Taylor
a71799ea2c Updated to OpenStack Build stuff. 2013-07-11 16:54:46 -04:00
Monty Taylor
85fe71617f Removed hg and google code references 2013-07-11 15:53:46 -04:00
Monty Taylor
e0edf4d4a1 Initial changes to import into StackForge. 2013-07-11 15:50:07 -04:00
Jan Dittberner
08cacdac59 update changelog 2013-02-09 13:08:53 +01:00
Jan Dittberner
d9f322cf6e fix error, Text columns have no width 2013-02-09 13:07:39 +01:00
Jan Dittberner
195f95550b fix deprecation warning by using MetaData.reflect 2013-02-09 13:02:59 +01:00
Jan Dittberner
2e26236baa update credits and changelog 2013-02-09 11:18:27 +01:00
Alex Favaro
2ff11c176a Import correct exceptions module (Fixes issue 154). 2013-02-09 11:15:26 +01:00
Jan Dittberner
84f4faf113 update changelog and credits 2012-01-23 21:36:13 +01:00
asuffield@gmail.com
fe1f1deca8 apply patch for issue #72 by asuffield@gmail.com
fixes #72
2012-01-23 21:34:12 +01:00
Jan Dittberner
ddad9c7f8c update changelog and credits 2011-12-17 20:27:22 +01:00
Jason Michalski
7a5148a30b Fix excludeTablesgetDiffOfModelAgainstModel is not passing
excludeTables correctly

Fixes issue 140
2011-12-17 20:25:04 +01:00
Jan Dittberner
08310eec9d start next development iteration 2011-11-01 22:10:37 +01:00
Jan Dittberner
aadd728366 Added signature for changeset ad06c76fc174 2011-11-01 21:35:16 +01:00
Jan Dittberner
da930f3b01 tag for release 0.7.2 2011-11-01 21:34:26 +01:00
Jan Dittberner
bd16556ddb finalize changelog for 0.7.2 0.7.2 2011-11-01 21:30:51 +01:00
Jan Dittberner
0958face62 add credits for contributors 2011-11-01 21:16:33 +01:00