These are no longer used and no longer necessary. Remove them.
Change-Id: Ibd7d46aefb3794dd342c8afb40dbb8d4ce00a976
Implements: blueprint remove-sqlalchemy-migrate
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
As downgrade are not supported after Kilo, we should remove them now.
Roll backs can be performed as mentioned in the below link:
http://docs.openstack.org/ops-guide/ops-upgrades.html#rolling-back-a-failed-upgrade
The DB downgrades were deprecated in Glance Mitaka release by commit
e3366afdfb.
Change-Id: I937d15d93f16a3e44a50e6ff1a469098eab67c79
Implements: blueprint remove-db-downgrade
We must have correct models i.e. models that correspond
a database schema to use sqlalchemy features.
Update models.py and add migration script to correct
database schema and get rid of the difference between
schema and models.
Partial-Bug: #1365436
Change-Id: I9b4571906d39bcdb35048caa58d16ad5e888cce4
Refactored migration tests to use OpportunisticTestCase, removed
unused code and ``test_migrations.conf`` file.
The main feature of this approach is to create a new database with
random name for each migration test. This will avoid migration tests of
race conditions and reduce tests intersection. After this change, database
``openstack_citest`` will be used only for initial connection to the database.
``test_migrations.conf`` file not required anymore, because we create test
database for migration test, so we no longer need to keep database credentials.
Partial-Bug: #1368274
Change-Id: Ib1d6dfae62cc60f814c01d07adc53f68e7c234f6
This commit makes the glance code base E125 and E126 compliant :
* E125 continuation line does not distinguish itself from next logical line
* E126 continuation line over-indented for hanging indent
Change-Id: I7120149bedb665fb66320498fe98948602a6cd52
Closes-bug: #1263437
Each project should directly use the standard uuid module.
uuidutils will be deprecated/removed in this cycle.
This patch replaces every uuidutils.generate_uuid() with
str(uuid.uuid4()) and uuidutils.is_uuid_like()
with utils.is_uuid_like().
Change-Id: I43642d4f1e137c14134b3d544e367b504b9851ac
Closes-Bug: #1253497
Implements bp db2-database
SQLAlchemy works in general, only changes needed to allow DB2
backend are these migration updates. The main difference
with DB2 is around index creation and constraints updates.
Change-Id: If5aa371328ef49ec93029ed15993871cfe5522cd
The upgrade from migration 11 to 12 for sqlite fails to create the
existing indexes when it recreates the image_properties table.
Fixes bug: 1152386
Change-Id: I2ceba3d9c5c45f40564af12fa48c4efba1467021
This commit adds support for running the migrations tests
with a PostgreSQL backend.
Migration 012 was changed because PostgreSQL's constraint
drop uses a different name to identify the foreign key
to be removed. The migration now handles it properly for
both postgres and mysql.
Change-Id: Ie8850608fc5f4bccda57a0b12c3b4adc8d1f61d0
This commit makes the necessary changes to enable the migrations
tests to pass with both mysql and sqlite. However the proper mysql
database still needs to be created beforehand for the tests to run
with mysql.
The sqlalchemy alter() method breaks on sqlite when mysql is enabled
for other databases. So for sqlite testing the alter() calls are now
done manually.
This also adds the MySQL-python module to the test-requires list
so that it will get installed for CI and the virtualenv used for
unit tests.
Change-Id: Ic72476b8e6a910c25747641ef1882639019b433e
This commit fixes 3 issues with migration 012:
First for the sqlite downgrade case the schema was being updated
before the data, which made it impossible to be applied. This
reverses the order of those calls correcting the issue.
Second, when the generate_uuid method was moved to one synced
from oslo the import was never updated in migration 012 which
was using generate_uuid(). This commit updates the imports and
uses of generate_uuid() to use the method in oslo.
Thirdly, this patch fixed the downgrade path to work for an image
table with more than one row.
Change-Id: Ib0d3d67e924748863dfdf8eb9e3257ec108ecf68
Move the core of glance.tests.unit.utils:FakeDB to glance.db.simple.
This 'simple' driver is an alternative to the traditional sqlalchemy
driver. Additionally, the sqlalchemy driver has been moved from
glance.db to glance.db.sqlalchemy. The simple db driver is only
available to be used by tests for now.
Related to bp refactor-db-layer
Change-Id: I9d33a433c0c03e53fb5a3491076086427ae694b3