* Reload browser after create/drop of database, schemas and tables
* Select on views
* Add foreign key constraint, with actions
+* Cascade drop on all objects
Version 3.0.0-dev-3
-------------------
Miscellaneous
-------------
-* Add support for RESTRICT/CASCADE in 7.3
+* -Add support for RESTRICT/CASCADE in 7.3 (chriskl)
Exotic
------
* A class that implements the DB interface for Postgres
* Note: This class uses ADODB and returns RecordSets.
*
- * $Id: Postgres.php,v 1.87 2003/04/30 07:37:39 chriskl Exp $
+ * $Id: Postgres.php,v 1.88 2003/04/30 07:42:58 chriskl Exp $
*/
// @@@ THOUGHT: What about inherits? ie. use of ONLY???
/**
* Drops a view.
* @param $viewname The name of the view to drop
+ * @param $cascade True to cascade drop, false to restrict
* @return 0 success
*/
- function dropView($viewname) {
+ function dropView($viewname, $cascade) {
$this->fieldClean($viewname);
$sql = "DROP VIEW \"{$viewname}\"";
+ if ($cascade) $sql .= " CASCADE";
return $this->execute($sql);
}
/**
* Manage views in a database
*
- * $Id: views.php,v 1.9 2003/04/23 08:19:03 chriskl Exp $
+ * $Id: views.php,v 1.10 2003/04/30 07:42:58 chriskl Exp $
*/
// Include application functions
echo "<input type=\"hidden\" name=\"action\" value=\"drop\">\n";
echo "<input type=\"hidden\" name=\"view\" value=\"", htmlspecialchars($_REQUEST['view']), "\">\n";
echo $misc->form;
- echo "<input type=\"submit\" name=\"yes\" value=\"{$lang['stryes']}\"> <input type=\"submi\"t name=\"no\" value=\"{$lang['strno']}\">\n";
+ // Show cascade drop option if supportd
+ if ($localData->hasDropBehavior()) {
+ echo "<p><input type=\"checkbox\" name=\"cascade\"> {$lang['strcascade']}</p>\n";
+ }
+ echo "<input type=\"submit\" name=\"yes\" value=\"{$lang['stryes']}\"> <input type=\"submit\" name=\"no\" value=\"{$lang['strno']}\">\n";
echo "</form>\n";
}
else {
- $status = $localData->dropView($_POST['view']);
+ $status = $localData->dropView($_POST['view'], isset($_POST['cascade']));
if ($status == 0)
doDefault($lang['strviewdropped']);
else