git-archimport-id: opensource@polytechnique.org--2005/platal--mainline--0.9--patch-52
alter table aliases add index (flags);
update aliases AS a
-left join aliases AS b ON(a.id=b.id and b.alias like '%.%' and length(b.alias)<length(a.alias))
+left join aliases AS b
+ ON(a.id=b.id and b.alias like '%.%' and length(b.alias)<length(a.alias) and b.type!='homonyme')
set a.flags=CONCAT(a.flags,',bestalias')
- where a.alias LIKE '%.%' and b.alias IS NULL and a.type!='homonyme' and b.type!='homonyme';
+ where a.alias LIKE '%.%' and b.alias IS NULL and a.type!='homonyme';