Fix #yogosha7605
This commit is contained in:
parent
0021381201
commit
aab9c2e6ca
@ -933,8 +933,9 @@ class DoliDBMysqli extends DoliDB
|
||||
public function DDLDropField($table, $field_name)
|
||||
{
|
||||
// phpcs:enable
|
||||
$sql = "ALTER TABLE ".$table." DROP COLUMN `".$field_name."`";
|
||||
dol_syslog(get_class($this)."::DDLDropField ".$sql, LOG_DEBUG);
|
||||
$tmp_field_name = preg_replace('/[^a-z0-9\.\-\_]/i', '', $field_name);
|
||||
|
||||
$sql = "ALTER TABLE ".$table." DROP COLUMN `".$tmp_field_name."`";
|
||||
if ($this->query($sql)) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -1240,8 +1240,9 @@ class DoliDBPgsql extends DoliDB
|
||||
public function DDLDropField($table, $field_name)
|
||||
{
|
||||
// phpcs:enable
|
||||
$sql = "ALTER TABLE ".$table." DROP COLUMN ".$field_name;
|
||||
dol_syslog($sql, LOG_DEBUG);
|
||||
$tmp_field_name = preg_replace('/[^a-z0-9\.\-\_]/i', '', $field_name);
|
||||
|
||||
$sql = "ALTER TABLE ".$table." DROP COLUMN ".$tmp_field_name;
|
||||
if (!$this->query($sql)) {
|
||||
$this->error = $this->lasterror();
|
||||
return -1;
|
||||
|
||||
@ -1120,8 +1120,9 @@ class DoliDBSqlite3 extends DoliDB
|
||||
public function DDLDropField($table, $field_name)
|
||||
{
|
||||
// phpcs:enable
|
||||
$sql = "ALTER TABLE ".$table." DROP COLUMN `".$field_name."`";
|
||||
dol_syslog(get_class($this)."::DDLDropField ".$sql, LOG_DEBUG);
|
||||
$tmp_field_name = preg_replace('/[^a-z0-9\.\-\_]/i', '', $field_name);
|
||||
|
||||
$sql = "ALTER TABLE ".$table." DROP COLUMN `".$tmp_field_name."`";
|
||||
if (!$this->query($sql)) {
|
||||
$this->error = $this->lasterror();
|
||||
return -1;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user