remove 'magic' types (ie SERIALs) from the type's list on the alter column page
authorioguix <ioguix>
Wed, 9 Jan 2008 23:02:38 +0000 (23:02 +0000)
committerioguix <ioguix>
Wed, 9 Jan 2008 23:02:38 +0000 (23:02 +0000)
TODO
colproperties.php

diff --git a/TODO b/TODO
index c05b419df0b13ac981c4f25582a3b298ef6cf49a..55bad6582eb05aecf2afb99438c7ae8c9f2935b6 100644 (file)
--- a/TODO
+++ b/TODO
@@ -90,6 +90,7 @@ Tables
 * Add WITH storage_parameter option to create table [8.2]
 * Add last vacuum and analyze information from statistics tables [8.2]
 * Restrict operators (from $selectOps array) to appropriate types (ie. no LIKE for int4 fields)
+* Restrict types to appropriate types when altering a column type
 * Where ENUM types are an option, restrict choice to enum values [8.3]
 
 
index 2e69a0ac1925919e987a369cac978694f7570ddc..d7f2a656ad8c7a1e6863c162829424397a9db56f 100644 (file)
@@ -20,7 +20,7 @@
        /**
         * Displays a screen where they can alter a column
         */
-       function doProperties($msg = '') {
+       function doAlter($msg = '') {
                global $data, $misc, $_reload_browser;
                global $lang;
 
                                        $types_for_js = array();
                                        
                                        echo "<td><select name=\"type\" id=\"type\" onchange=\"checkLengths(document.getElementById('type').value,'');\">\n";                           
-                                       // Output any "magic" types.  This came in with Alter Column Type so we don't need to check that
-                                       foreach ($data->extraTypes as $v) {
-                                               $types_for_js[] = strtolower($v);
-                                               echo "\t<option value=\"", htmlspecialchars($v), "\"",
-                                               ($v == $_REQUEST['type']) ? ' selected="selected"' : '', ">",
-                                                       $misc->printVal($v), "</option>\n";
-                                       }
                                        while (!$types->EOF) {
                                                $typname = $types->fields['typname'];
                                                $types_for_js[] = $typname;
                                // Check inputs
                                if (trim($_REQUEST['field']) == '') {
                                        $_REQUEST['stage'] = 1;
-                                       doProperties($lang['strcolneedsname']);
+                                       doAlter($lang['strcolneedsname']);
                                        return;
                                }
                                if (!isset($_REQUEST['length'])) $_REQUEST['length'] = '';
                                }
                                else {
                                        $_REQUEST['stage'] = 1;
-                                       doProperties($lang['strcolumnalteredbad']);
+                                       doAlter($lang['strcolumnalteredbad']);
                                        return;
                                }
                                break;
                switch ($action) {
                        case 'properties':
                                if (isset($_POST['cancel'])) doDefault();
-                               else doProperties();
+                               else doAlter();
                                break;
                        default:
                                doDefault();