From 9fc5dc490e1404604e8ef9a8659badd47a63a449 Mon Sep 17 00:00:00 2001 From: Brant Knudson Date: Fri, 26 Jun 2015 12:10:42 -0500 Subject: [PATCH] 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 --- .../db/sqlalchemy/migrate_repo/versions/037_sqlite_upgrade.sql | 1 - 1 file changed, 1 deletion(-) diff --git a/glance/db/sqlalchemy/migrate_repo/versions/037_sqlite_upgrade.sql b/glance/db/sqlalchemy/migrate_repo/versions/037_sqlite_upgrade.sql index 200cbd14d8..c7444158e5 100644 --- a/glance/db/sqlalchemy/migrate_repo/versions/037_sqlite_upgrade.sql +++ b/glance/db/sqlalchemy/migrate_repo/versions/037_sqlite_upgrade.sql @@ -145,7 +145,6 @@ CREATE TABLE image_properties ( deleted BOOLEAN NOT NULL, PRIMARY KEY (id), CHECK (deleted IN (0, 1)), - UNIQUE (image_id, name), FOREIGN KEY(image_id) REFERENCES images (id), CONSTRAINT ix_image_properties_image_id_name UNIQUE (image_id, name) );