Skip to content

Commit

Permalink
Merge pull request #32848 from hregis/fix_20_sql_error
Browse files Browse the repository at this point in the history
FIX DROP INDEX IF EXISTS it's not possible !
eldy authored Jan 29, 2025
2 parents b167d6e + 7bd2bb6 commit 5dca2af
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion htdocs/core/class/extrafields.class.php
Original file line number Diff line number Diff line change
@@ -749,7 +749,7 @@ public function update($attrname, $label, $type, $length, $elementtype, $unique
$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');

0 comments on commit 5dca2af

Please sign in to comment.