summaryrefslogtreecommitdiffstats
path: root/checksetup.pl
diff options
context:
space:
mode:
Diffstat (limited to 'checksetup.pl')
-rwxr-xr-xchecksetup.pl10
1 files changed, 6 insertions, 4 deletions
diff --git a/checksetup.pl b/checksetup.pl
index 3c4793407..c9ced42ec 100755
--- a/checksetup.pl
+++ b/checksetup.pl
@@ -2094,12 +2094,14 @@ sub AddFDef ($$$) {
my ($fieldid) = ($sth->fetchrow_array());
if (!$fieldid) {
$fieldid = 'NULL';
- }
-
- $dbh->do("REPLACE INTO fielddefs " .
+ $dbh->do("INSERT INTO fielddefs " .
"(fieldid, name, description, mailhead, sortkey) VALUES " .
"($fieldid, $name, $description, $mailhead, $headernum)");
- $headernum++;
+ $headernum++;
+ } else {
+ $dbh->do("UPDATE fielddefs SET name = $name, description = $description, " .
+ "mailhead = $mailhead WHERE fieldid = $fieldid");
+ }
}