diff --git a/sql/upgrades/003.sql b/sql/upgrades/003.sql index 95191b6..ab706b3 100644 --- a/sql/upgrades/003.sql +++ b/sql/upgrades/003.sql @@ -1,13 +1,16 @@ -- SWH DB schema upgrade -- from_version: 2 -- to_version: 3 -- description: keep unique indices for origins and locations in a hash column insert into dbversion(version, release, description) values(3, now(), 'Work In Progress'); -drop index if exists location_path_key; -create unique index on location(digest(path::bytea, 'sha1'::text)); +alter table location + drop constraint if exists location_path_key; -drop index if exists origin_url_key; +create unique index on location(digest(path, 'sha1')); + +alter table origin + drop constraint if exists origin_url_key;