Fixed a problem with creating a fresh database on pgsql

This commit is contained in:
jengo 2000-10-17 23:16:47 +00:00
parent e1c60e9daf
commit 8c677fa8ce
2 changed files with 8 additions and 10 deletions

View File

@ -11,11 +11,9 @@
/* $Id$ */ /* $Id$ */
$sql = "CREATE TABLE config ( $sql = "CREATE TABLE config (
config_name varchar(25), config_name varchar(25) NOT NULL UNIQUE,
config_value varchar(100), config_value varchar(100) NOT NULL
UNIQUE (config_name)
)"; )";
$db->query($sql); $db->query($sql);

View File

@ -33,8 +33,8 @@
$db->Halt_On_Error = "no"; $db->Halt_On_Error = "no";
if (!isset($oldversion)){ if (!isset($oldversion)){
$db->query("select app_version from applications where app_name='admin'"); @$db->query("select app_version from applications where app_name='admin'");
$db->next_record(); @$db->next_record();
$oldversion = $db->f("app_version"); $oldversion = $db->f("app_version");
} }
@ -201,10 +201,10 @@
Header("Location: $PHP_SELF?action=regularversion"); Header("Location: $PHP_SELF?action=regularversion");
} }
}else{ }else{
$db->query("select * from config"); @$db->query("select * from config");
if ($db->num_rows() == 0){ if (@$db->num_rows() == 0){
$db->query("select * from accounts"); @$db->query("select * from accounts");
if ($db->num_rows() == 0){ if (@$db->num_rows() == 0){
echo "<html><head><title>phpGroupWare Setup</title></head>\n"; echo "<html><head><title>phpGroupWare Setup</title></head>\n";
echo "<body bgcolor='#ffffff'>\n"; echo "<body bgcolor='#ffffff'>\n";
echo "<table border=\"0\" align=\"center\">\n"; echo "<table border=\"0\" align=\"center\">\n";