mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-08 00:52:01 +01:00
Fix: missing tinyint
This commit is contained in:
@@ -297,7 +297,7 @@ class DoliDBPgsql
|
||||
// To have postgresql case sensitive
|
||||
$line=str_replace(' LIKE \'',' ILIKE \'',$line);
|
||||
$line=str_replace(' LIKE BINARY \'',' LIKE \'',$line);
|
||||
|
||||
|
||||
// Delete using criteria on other table must not declare twice the deleted table
|
||||
// DELETE FROM tabletodelete USING tabletodelete, othertable -> DELETE FROM tabletodelete USING othertable
|
||||
if (preg_match('/DELETE FROM ([a-z_]+) USING ([a-z_]+), ([a-z_]+)/i',$line,$reg))
|
||||
@@ -1219,11 +1219,13 @@ class DoliDBPgsql
|
||||
{
|
||||
$sql = "ALTER TABLE ".$table;
|
||||
$sql .= " MODIFY COLUMN ".$field_name." ".$field_desc['type'];
|
||||
if ($field_desc['type'] == 'int' || $field_desc['type'] == 'varchar') $sql.="(".$field_desc['value'].")";
|
||||
if ($field_desc['type'] == 'tinyint' || $field_desc['type'] == 'int' || $field_desc['type'] == 'varchar') {
|
||||
$sql.="(".$field_desc['value'].")";
|
||||
}
|
||||
|
||||
// FIXME May not work with pgsql. May need to run a second request. If it works, just remove the FIXME tag
|
||||
if ($field_desc['null'] == 'not null' || $field_desc['null'] == 'NOT NULL') $sql.=" NOT NULL";
|
||||
|
||||
|
||||
dol_syslog($sql,LOG_DEBUG);
|
||||
if (! $this->query($sql))
|
||||
return -1;
|
||||
|
||||
Reference in New Issue
Block a user