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
This commit is contained in:
Brant Knudson 2015-06-26 12:10:42 -05:00 committed by Roman Podoliaka
parent e68b6c1a86
commit 9fc5dc490e
1 changed files with 0 additions and 1 deletions

View File

@ -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)
);