Add Constraints only if necessary

This commit is contained in:
Marc Delisle
2003-11-22 12:44:23 +00:00
parent c70721ffe8
commit fc764a3b29
2 changed files with 10 additions and 0 deletions

View File

@@ -5,6 +5,10 @@ phpMyAdmin - Changelog
$Id$ $Id$
$Source$ $Source$
2003-11-22 Marc Delisle <lem9@users.sourceforge.net>
* tbl_properties_operations.php: display "Add constraints" only
if there are foreign keys in current table
2003-11-21 Marc Delisle <lem9@users.sourceforge.net> 2003-11-21 Marc Delisle <lem9@users.sourceforge.net>
* tbl_move_copy.php: typo about constraints * tbl_move_copy.php: typo about constraints

View File

@@ -208,9 +208,15 @@ for ($i = 0; $i < $num_dbs; $i++) {
<label for="checkbox_drop"><?php echo $strStrucDrop; ?></label>&nbsp;&nbsp;<br /> <label for="checkbox_drop"><?php echo $strStrucDrop; ?></label>&nbsp;&nbsp;<br />
<input type="checkbox" name="auto_increment" value="1" id="checkbox_auto_increment" /> <input type="checkbox" name="auto_increment" value="1" id="checkbox_auto_increment" />
<label for="checkbox_auto_increment"><?php echo $strAddAutoIncrement; ?></label><br /> <label for="checkbox_auto_increment"><?php echo $strAddAutoIncrement; ?></label><br />
<?php
// display "Add constraints" choice only if there are
// foreign keys
if (PMA_getForeigners($db, $table, '', 'innodb')) {
?>
<input type="checkbox" name="constraints" value="1" id="checkbox_constraints" /> <input type="checkbox" name="constraints" value="1" id="checkbox_constraints" />
<label for="checkbox_constraints"><?php echo $strAddConstraints; ?></label><br /> <label for="checkbox_constraints"><?php echo $strAddConstraints; ?></label><br />
<?php <?php
} // endif
if (isset($_COOKIE) && isset($_COOKIE['pma_switch_to_new']) && $_COOKIE['pma_switch_to_new'] == 'true') { if (isset($_COOKIE) && isset($_COOKIE['pma_switch_to_new']) && $_COOKIE['pma_switch_to_new'] == 'true') {
$pma_switch_to_new = 'true'; $pma_switch_to_new = 'true';
} elseif (isset($HTTP_COOKIE_VARS) && isset($HTTP_COOKIE_VARS['pma_switch_to_new']) && $HTTP_COOKIE_VARS['pma_switch_to_new'] == 'true') { } elseif (isset($HTTP_COOKIE_VARS) && isset($HTTP_COOKIE_VARS['pma_switch_to_new']) && $HTTP_COOKIE_VARS['pma_switch_to_new'] == 'true') {