Fix the primary key on the dev branch.

This commit is contained in:
Mark Crane
2013-09-07 16:25:35 +00:00
parent e56ee666cf
commit cdf54c6267
2 changed files with 5 additions and 2 deletions

View File

@@ -72,10 +72,10 @@ include "root.php";
else {
$sql .= $field['type'];
}
if ($field['key']['type'] == "primary") {
if ($field['key'] == "primary") {
$sql .= " PRIMARY KEY";
}
if ($field['key']['type'] == "foreign") {
if ($field['key'] == "foreign") {
if ($this->db_type == "pgsql") {
//$sql .= " references ".$field['key']['reference']['table']."(".$field['key']['reference']['field'].")";
}

View File

@@ -188,6 +188,9 @@ function db_create_table ($apps, $db_type, $table) {
else {
$sql .= $field['type'];
}
if ($field['key'] == "primary") {
$sql .= " PRIMARY KEY";
}
$field_count++;
}
}