Merge pull request #32848 from hregis/fix_20_sql_error

FIX DROP INDEX IF EXISTS it's not possible !
This commit is contained in:
Laurent Destailleur 2025-01-29 16:49:30 +01:00 committed by GitHub
commit 5dca2af8a4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -749,7 +749,7 @@ class ExtraFields
$sql = "ALTER TABLE ".$this->db->prefix().$table." ADD UNIQUE INDEX uk_".$table."_".$this->db->sanitize($attrname)." (".$this->db->sanitize($attrname).")";
} else {
dol_syslog(get_class($this).'::update_common', LOG_DEBUG);
$sql = "ALTER TABLE ".$this->db->prefix().$table." DROP INDEX IF EXISTS uk_".$table."_".$this->db->sanitize($attrname);
$sql = "ALTER TABLE ".$this->db->prefix().$table." DROP INDEX uk_".$table."_".$this->db->sanitize($attrname);
}
dol_syslog(get_class($this).'::update', LOG_DEBUG);
$resql = $this->db->query($sql, 1, 'dml');