Commit Graph

16 Commits

Author SHA1 Message Date
Stephen Finucane b28b0e29d2 db: Remove old sqlalchemy-migrate migrations
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>
2021-07-13 17:18:55 +01:00
wangxiyuan 2f803d3fa9 Remove DB downgrade
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
2016-09-01 10:53:08 +08:00
Oleksii Chuprykov 9def368d07 Alter models and add migration
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
2014-11-25 17:17:15 +02:00
Julien Danjou fadbef8511 hacking: upgrade to 0.9.x serie
Change-Id: I252758fd633662de9659a402c5e3d7e3ce1fae0f
2014-10-06 14:41:03 +02:00
Oleksii Chuprykov e518ab629b Refactor test_migrations module
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
2014-09-30 14:32:40 +03:00
Noboru arai 8de10b0f34 Remove vim header
No need to set tabstop tons of times, this can be set in your vimrc
file instead.

More disucssion:
http://openstack.10931.n7.nabble.com/Remove-vim-modelines-td21780.html

Change-Id: I3b830a5bb831a63c188109e6fad66ba48884fff3
Partial-Bug: #1229324
2014-01-14 16:03:28 +00:00
Yanis Guenane ec08ca1a87 Make code base E125 and E126 compliant
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
2013-12-30 13:03:24 +00:00
Arnaud Legendre 11b5487eff Use uuid instead of uuidutils
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
2013-12-24 11:43:17 -08:00
David Peraza 61f47af345 DB migration changes to support DB2 as sqlalchemy backend
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
2013-12-03 01:25:02 +08:00
Dirk Mueller 518bbf7298 Changed header from LLC to Foundation based on trademark policies
Fixes: Bug 1214176

Change-Id: I4e394c33d810fe7d48066ff7cb6143f7eae25f13
2013-09-10 18:29:53 +02:00
John Bresnahan 40c94e7c36 Retain migration 12 indexes for table image_properties with sqlite.
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
2013-03-07 15:00:35 -10:00
Matthew Treinish 2b180a2b6d Add PostgreSQL support to test migrations.
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
2013-02-28 11:59:26 -05:00
Matthew Treinish 70907328ea Enable support for MySQL with test migrations.
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
2013-02-28 11:57:33 -05:00
Matthew Treinish 31cae6ac40 Fix issues with migration 012
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
2013-02-14 15:06:21 +00:00
Alex Meade 5d53e99e0a Remove unused imports in db migrations
I went on a hike through the migrations and decided to apply the boyscout rule.
Scouts honor.

Change-Id: I10c677cfd5186edce3ca96495eafc732168cac86
2012-06-19 15:43:55 -04:00
Brian Waldon a68eb24431 Create 'simple' db driver
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
2012-06-07 09:20:50 -07:00