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
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
Wayne Okuma 477230379d Incorrect permissions on database migration file
The 042_add_changes_to_reinstall_unique_metadef_constraints.py file was
checked in with file permissions of 775. This should be restricted to
644.

Change-Id: I4b8359046e3a592c6a73676d30f22da7f07e3299
Closes-Bug: 1494895
2015-09-11 20:30:54 +00:00
Wayne Okuma 5369e86e8d Glance metadef tables need unique constraints.
Sometime during Kilo, the unique constraints on
metadef_namespaces (namespace)
metadef_objects(namespace_id, name)
metadef_properties(namespace_id, name)
metadef_tags(namespace_id, name)
metadef_resource_types(name)
were replaced with non-unique indices.

I believe this was done erroneously to make the migrate_repo/versions/scripts
match the db/sqlalchemy/models_metadef.py definitions. Unfortunately, the
schema scripts were correct with the unique constraints and what should have
changed was models_metadef.py.

This bug, puts one more migrate script in place which will rename any
duplicate records it finds to make them unique and then re-establishes
the unique constraints while dropping the non-unique indices. It also,
fixes models_metadef.py and adds in tests to attempt to create duplicates
which should result in an HTTPConflict.

Change-Id: Idf3569a27d64abea3ed6ec92fb77b36a4d6d5fd5
Closes-Bug: 1468946
2015-09-02 22:32:29 -07:00