100 Commits

Author SHA1 Message Date
Jenkins
e20068490b Merge "Eradicate trailing whitespace" 2014-03-29 18:27:33 +00: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
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
Jenkins
0ffaaae935 Merge "UniqueConstraint named and escaped twice" 2014-03-05 08:46:17 +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
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
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
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
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
Josip Delic
c670d1d36a added bugfixes for 0.8 2013-07-11 17:07:04 -04:00
Jan Dittberner
a48190c006 merge e5bd2821eea8 from https://code.google.com/r/alyazdi-patches/
(fixes issue 125)
2011-10-28 12:25:22 +02:00
Jan Dittberner
3619347441 drop SQLAlchemy < 0.6 compatibility code 2011-10-28 10:59:10 +02:00
Jan Dittberner
95a329b16a fix SQLAlchemy 0.6.x compatibility of issue 128 patch 2011-10-28 10:06:19 +02:00
markbmc@gmail.com
6ecf665f14 fix issue 128: "table rename failure with sqlalchemy 0.7.x" 2011-10-28 09:34:08 +02:00
al.yazdi@gmail.com
cef7676b58 Fix for issue #125, create the table on the same connection as the ALTER and INSERT happen 2011-10-26 06:32:59 +00:00
Jan Dittberner
ca5d59910a fix column.create() properly 2011-05-27 21:59:35 +02:00
Jan Dittberner
27e24c3374 no special treatment for SQLA 0.7 required in migrate.changeset.ansisql 2011-05-27 12:55:11 +02:00
Jan Dittberner
108f28ae6b remove commented code 2011-05-26 21:56:11 +02:00
Jan Dittberner
1af477e661 fix unit test for adding new columns with foreign keys 2011-05-26 21:43:27 +02:00
Jan Dittberner
e11a9e5cba use Table._columns to remove columns (addresses #112)
- add SQLA_07 predicate in migrate/changeset/__init__.py

- use Table._columns instead of Table.c when removing columns in
  migrate/changeset/schema.py
2011-05-25 15:29:28 +02:00
Chris Withers
0645c2fc9a Bring back alter_metadata on ColumnDelta: it seems intertwined with a lot of the tests.
So, it's a private API now...
2011-02-11 10:27:39 +00:00
Chris Withers
cda65c38b5 try to get firebird stuff working with 0.6.6 2011-02-10 17:02:42 +00:00
Chris Withers
b5a02cb7cf remove the alter_metadata feature 2011-02-10 16:49:20 +00:00
Chris Withers
c80120da55 work around firebird's insistence that indexes and constraints are dropped before columns that are references by them. 2011-02-10 15:19:00 +00:00
Chris Withers
500cb6f5df fix sqlite column dropper now that the table is only modified after the visitor is run 2011-02-10 15:17:28 +00:00
Chris Withers
9c9fe2fc24 Only alter the SA objects after running the visitor, so the visitor may inspect 2011-02-10 15:15:22 +00:00
Jan Dittberner
05e39b2c6c make migrate.changeset.constraint.ForeignKeyConstraint.autoname work
with SQLAlchemy 0.5 and 0.6
2010-11-09 22:33:20 +01:00
Jan Dittberner
a3ae4baa29 use _index_identifier instead of _validate_identifier if
_validate_identifier does not exist in migrate/changeset/ansisql.py

remove executable bits from migrate/tests/fixture/warnings.py
2010-11-09 21:38:17 +01:00
Jan Dittberner
73796f3e54 fix generation of foreign key constraint name in
migrate.changeset.constraint.ForeignKeyConstraint.autoname

use <table>_<firstcol>_fkey instead of <table>_<reftable>_fkey

Fixes Issue 101
2010-11-07 22:19:36 +01:00
chrisw
adf4113a0b Fix issue 94 - it was impossible to add a column with a non-unique index.
Also implement more functionality with unique and foreign key constrains for sqlite.
2010-09-09 15:38:42 +01:00
chrisw
a085ffa590 implement column adding with foreign keys on sqlite 2010-09-09 13:58:41 +01:00
chrisw
a7c0c18a52 Fix bug with column dropping involving foreign keys.
Bonus: remove_from_table now understands foreign keys
2010-09-09 11:53:08 +01:00
chrisw
5cf42fbf76 fix for issue 96: deleting a column in sqlite shouldn't delete all indexes
bonus: remove_from_table now removes indexes
2010-09-09 09:15:28 +01:00
chrisw
aef73ed13e attempt at improving the api docs a little 2010-09-08 15:48:28 +01:00
chrisw
cade5fb261 - capture deprecation warnings and assert they re as they should be
- re-word alter_column deprecation warning to make more sense
2010-09-07 19:04:12 +01:00
iElectric
653e723ce1 move all exception classes to migrate.exceptions 2010-09-07 02:25:29 +02:00
iElectric
878c673ca8 fix tests on python2.7 2010-07-14 19:04:44 +02:00
iElectric
811201d47b small doc correction; fixes #67 2010-07-11 18:16:51 +02:00
iElectric
201fe50e6c better document summary of changeset actions 2010-07-11 17:45:29 +02:00
iElectric
a3d3470d5e adding connection keyword to ORM methods 2010-07-11 17:22:28 +02:00
Jan Dittberner
e820261f29 fix unittests
* tested with Python 2.6, SQLAlchemy 0.6.1, PostgreSQL, MySQL and SQLite
2010-07-04 12:33:28 +02:00
iElectric
8b0072b3e8 move to unittest2, update README for testing instructions 2010-06-20 15:29:16 +02:00
iElectric
6e025c4a4d add firebird to test_db.cfg.tmpl; fix bug when dropping a column in firebird: also drop related constraint or index 2010-05-11 22:52:07 +02:00
iElectric
ece9ffed35 fix MySQL failing tests with autoincrement 2010-05-02 20:31:50 +02:00
iElectric
81f447ef77 SA06 tests fix, thanks to Mike Bayer 2010-05-02 03:03:03 +02:00
iElectric
43e0c3caf2 unified warnings, use compare columns in tests 2010-05-01 08:32:41 +02:00
iElectric
feab45798f move warning exceptions to right module 2010-05-01 07:38:33 +02:00
iElectric
cef2abb30f deprecate two columns alter 2010-04-30 08:34:30 +02:00
iElectric
e4868841d5 partly fix SA0.6 tests on postgres 2010-04-24 21:40:16 +02:00