Vergleich inc/db_pgsql.php - 1.8.11 - 1.8.12

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 1093Zeile 1093

$primary_key = array();
$primary_key_name = '';


$primary_key = array();
$primary_key_name = '';

 

$unique_keys = array();


// We do this in two steps. It makes placing the comma easier
while($row = $this->fetch_array($query))


// We do this in two steps. It makes placing the comma easier
while($row = $this->fetch_array($query))

Zeile 1101Zeile 1103
			{
$primary_key[] = $row['column_name'];
$primary_key_name = $row['index_name'];

			{
$primary_key[] = $row['column_name'];
$primary_key_name = $row['index_name'];

 
			}

if($row['unique_key'] == 't')
{
$unique_keys[$row['index_name']][] = $row['column_name'];

			}
}

if(!empty($primary_key))
{
$lines[] = " CONSTRAINT $primary_key_name PRIMARY KEY (".implode(', ', $primary_key).")";

			}
}

if(!empty($primary_key))
{
$lines[] = " CONSTRAINT $primary_key_name PRIMARY KEY (".implode(', ', $primary_key).")";

 
		}

foreach($unique_keys as $key_name => $key_columns)
{
$lines[] = " CONSTRAINT $key_name UNIQUE (".implode(', ', $key_columns).")";

		}

$table_lines .= implode(", \n", $lines);

		}

$table_lines .= implode(", \n", $lines);