Commit Graph

4 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
Brant Knudson 9fc5dc490e Fix duplicate unique constraint in sqlite migration
The sqlite migration 37 created duplicate unique constraints on
the image_properties table, one unnamed and one called
ix_image_properties_image_id_name.

This causes the unit tests to fail with sqlalchemy 1.0+ since it
catches the problem when it compares the model to the schema.

The fix is to only create the named constraint.

Change-Id: I7ee19f08f2c107987e763466dc6e3b07185598c9
Closes-Bug: #1467008
2015-06-27 05:53:37 +00:00
Ihar Hrachyshka 92a7111e9e SQL scripts should not manage transactions
Glance SQL scripts assume too much about the environment and the way in
which they are executed by sqlalchemy-migrate. Particularly, they manage
transactions on their own even though sqlalchemy-migrate do it itself,
plus it assumes that scripts are executed in one go (even though
standard Python DB-API 2.0 does not mention multi-statement SQL commands
to be executed on DB cursors.

Also fix comments to be actual SQL comments and not C comments

https://blueprints.launchpad.net/oslo.db/+spec/enable-mysql-connector

Change-Id: I10c58b3af75d3ab9153a8bbd2a539bf1577de328
Closes-Bug: 1368391
Closes-Bug: 1410494
2015-01-13 22:21:00 +00: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