summaryrefslogtreecommitdiff
path: root/tests/sqlalchemy/test_migrations.py
Commit message (Collapse)AuthorAgeFilesLines
* Move files out of the namespace packageDoug Hellmann2014-12-241-309/+0
| | | | | | | | | | Move the public API out of oslo.db to oslo_db. Retain the ability to import from the old namespace package for backwards compatibility for this release cycle. Blueprint: drop-namespace-packages Change-Id: Ie96b482b9fbcb1d85203ad35bb65c1f43e912a44
* Repair include_object to accommodate new objectsMike Bayer2014-11-211-2/+5
| | | | | | | | | | | | | The tests in tests/sqlalchemy/test_migrations.py which expect to see changes in unique constraints fail due to the assumption that the "include_object" feature of Alembic only deals with the 'table' and 'column' constructs. As Alembic 0.7.0 has added include_object support for 'index' and 'unique_constraint', this method should not be limiting itself to not include objects that it's testing for. Tests won't pass on Alembic 0.7.0 without this patch. Change-Id: Ia71446bb8c0b248c6310534deb290524e3946987
* ModelsMigrationsSync: Add check for foreign keysAnn Kamyshnikova2014-10-171-0/+12
| | | | | | | Add method that checks that foreign keys in models are synchonized with foreign keys that are created in database. Change-Id: I4a776da0f53a79218ed4b111cac33b37d264fa1b
* ModelsMigrationsSync:add correct server_default check for EnumAnn Kamyshnikova2014-09-151-0/+9
| | | | | | | | | | | | If Column which type is Enum has server_default it is compared incorrectly for PostgreSQL. For example, Column('test', sa.Enum('one', 'two', name='enum'), server_default='one'). In model it has DefaultClause('one', for_update=False)) alembic finds it different from server variant "'one'::enum". Change-Id: Id30858f9c4c7a2bfb7f9313d47930845fe354a70
* Merge "Renaming in WalkVersionsMixin"Jenkins2014-09-091-29/+29
|\
| * Renaming in WalkVersionsMixinOleksii Chuprykov2014-09-051-29/+29
| | | | | | | | | | | | | | | | | | | | | | Rename _walk_versions(), _migrate_up(), _migrate_down() and mark them deprecated as they will be removed in few releases. These functions will be the part of public API as this class will be used for migrations in other OpenStack projects, so there is no need to make them 'private'. Change-Id: Ic9358445e60a0dd43a5900e8bda7b12f2bebf679
* | ModelsMigrationsSync:Override compare_server_defaultAnn Kamyshnikova2014-09-031-0/+14
|/ | | | | | | | | | | | | | | This test showed an error with alembic 0.6.6: For MySQL Integer server_default value is compared incorrectly. For example, when model has DefaultClause('0', for_update=False) alembic finds it different from server variant "'0'". For PostgreSQL Sting server_default value is compared incorrectly. For example, when model has DefaultClause('', for_update=False) alembic finds it different from server variant "''::character varying". Such error appear in implementation of ModelsMigrationsSync to Neutron https://review.openstack.org/76520. Change-Id: I9730da1c0790a88f81570c51c36cc0cbe0651a5a
* Fixes indentations to pass E128 check.Petr Blaho2014-08-031-2/+4
| | | | | | | Fixes indentations to pass E128 check. Removes E128 from ignore setting in tox.ini. Change-Id: I92ca574c076b4bd26e424a3b404188601264b5de
* Opportunistic migration testsIlya Pekelny2014-07-161-37/+48
| | | | | | | | | | | | | | | | | Migrations should be tested with real database backends. For this goal intended number of base test cases which used in current implementation. Previously there were two ways to run migration tests: using opportunistic test cases (default way we've been using on CI) and by using database connection strings, specified in test_migrations.conf, for every particular database test case. For the sake of simplicity and consistency we are moving to using of opportunistic db test cases here. With this change we are free from locking, so we don't need `lockfile` anymore. Closes-Bug: #1327397 Closes-Bug: #1328997 Change-Id: I92b1dcd830c4755f429a0f6529911e607c2c7de7
* Add a base test case for DB schema comparison0.3.0Roman Podoliaka2014-07-081-2/+106
| | | | | | | | | | | | | | | | Add a base test case that allows to check if the DB schema obtained by applying of migration scripts is equal to the one produced from models definitions. It's very important that those two stay in sync to be able to use models definitions for generation of the initial DB schema. Though, due to the using of sqlalchemy-migrate (since we had to write migration scripts manually and alembic can generate them automatically) we have many divergences in projects right now, which must be detected and fixed. Fortunately, we can now rely on alembic + sqlalchemy implementation of schema comparison instead of writing our own tools. Blueprint: sync-models-with-migrations Change-Id: I2d2c35987426dacb1f566569d23a80eee3575a58
* Make the tests passingVictor Sergeyev2014-04-181-0/+154
- add missed requirements - add required modules from openstack.common - added entry points to setup.cfg - fixed tests location - fixed incorrect common modules imports