From 510d1e786e426a698ae59c3f1c0bf1afa4b6ff92 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 29 Nov 2007 06:50:25 +0000 Subject: [PATCH] "marking auto columns automatic as primary key and not null" --- etemplate/inc/class.db_tools.inc.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/etemplate/inc/class.db_tools.inc.php b/etemplate/inc/class.db_tools.inc.php index 059bd296dc..49a4036b7b 100644 --- a/etemplate/inc/class.db_tools.inc.php +++ b/etemplate/inc/class.db_tools.inc.php @@ -430,6 +430,11 @@ for (reset($content),$n = 1; isset($content["Row$n"]); ++$n) { $col = $content["Row$n"]; + + if ($col['type'] == 'auto') // auto columns are the primary key and not null! + { + $col['pk'] = $col['notnull'] = true; // set it, in case the user forgot + } while ((list($old_name,$old_col) = @each($old_cols)) && $this->changes[$posted_table][$old_name] == '**deleted**') ;