# HG changeset patch # User Julien Cristau # Date 1421408612 -3600 # Node ID 249126034c0e5e3a4588f570277f4711d778717a # Parent 5ec5d17b5e5bb759e3fe664ba6fc44c0328ed9c9 Add unique index on entities.extid diff -r 5ec5d17b5e5b -r 249126034c0e misc/migration/3.21.0_Any.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/misc/migration/3.21.0_Any.py Fri Jan 16 12:43:32 2015 +0100 @@ -0,0 +1,5 @@ + +helper = repo.system_source.dbhelper +sql('DROP INDEX entities_extid_idx') +sql(helper.sql_create_index('entities', 'extid', True)) +commit() diff -r 5ec5d17b5e5b -r 249126034c0e server/sources/native.py --- a/server/sources/native.py Fri Jan 16 11:17:53 2015 +0100 +++ b/server/sources/native.py Fri Jan 16 12:43:32 2015 +0100 @@ -1387,10 +1387,9 @@ eid INTEGER PRIMARY KEY NOT NULL, type VARCHAR(64) NOT NULL, asource VARCHAR(128) NOT NULL, - extid VARCHAR(256) + extid VARCHAR(256) UNIQUE );; CREATE INDEX entities_type_idx ON entities(type);; -CREATE INDEX entities_extid_idx ON entities(extid);; CREATE TABLE transactions ( tx_uuid CHAR(32) PRIMARY KEY NOT NULL,