cvs: pear /Gtk_MDB_Designer package.xml /Gtk_MDB_Designer/Designer Column.php Table.php
| From: | Alan Knowles | Date: | Sun, 23 Mar 2003 04:29:26 +0000 |
| Subject: | cvs: pear /Gtk_MDB_Designer package.xml /Gtk_MDB_Designer/Designer Column.php Table.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-9573@lists.php.net to get a copy of this message | ||
alan_k Sat Mar 22 23:29:26 2003 EDT
Modified files:
/pear/Gtk_MDB_Designer package.xml
/pear/Gtk_MDB_Designer/Designer Column.php Table.php
Log:
fix sequence and index naming - todo still sort out inheritance creation order
Index: pear/Gtk_MDB_Designer/package.xml
diff -u pear/Gtk_MDB_Designer/package.xml:1.4 pear/Gtk_MDB_Designer/package.xml:1.5
--- pear/Gtk_MDB_Designer/package.xml:1.4 Sat Mar 22 12:34:22 2003
+++ pear/Gtk_MDB_Designer/package.xml Sat Mar 22 23:29:25 2003
@@ -2,19 +2,21 @@
<!DOCTYPE package SYSTEM "../package.dtd">
<package version="1.0">
<name>Gtk_MDB_Designer</name>
- <summary>An Gtk Database designer</summary>
+ <summary>An Gtk Database schema designer</summary>
<description>
A graphical database schema designer, based loosely around the MDB schema,
it features
- - table boxes which are draged around a window to layout your database
+ - table boxes which are dragged around a window to layout your database
- add/delete tables
- add delete columns
- - support for NotNull, Indexes, Sequences and Unique Indexes, defaults
+ - support for NotNull, Indexes, Sequences , Unique Indexes and defaults
- works totally in non-connected mode (eg. no database or setting up required)
- stores in MDB like xml file.
- saves to any supported database SQL create tables files.
- screenshots at http://devel.akbkhome.com/Gtk_MDB/
+
+
Future enhancements:
- real MDB schema exports
- relationships = with lines etc.
@@ -22,6 +24,7 @@
Note: the primary aim is to generate SQL files, (so that I can get my work done)
however it is eventually planned to support MDB schema's fully.. - just a matter of time..
+ To use - just pear install and run gtkmdbdesigner
</description>
<license>PHP License</license>
@@ -37,12 +40,10 @@
<release>
- <version>0.1</version>
- <date>2003-03-23</date>
+ <version>0.2</version>
+ <date>2003-03-24</date>
<notes>
- - First release version
- - Available for testing.
-
+ - Fix sql generation
</notes>
<state>beta</state>
@@ -83,12 +84,27 @@
</filelist>
-
+ <deps>
+ <dep type="php" rel="ge" version="4.3"/>
+ <dep type="pkg" rel="ge" version="1.1.1">MDB</dep>
+ <dep type="pkg" rel="ge"
version="1.0.1">XML_Parser</dep>
+ </deps>
<changelog>
+ <release>
+ <version>0.1</version>
+ <date>2003-03-23</date>
+ <notes>
+ - First release version
+ - Available for testing.
+ Requires MDB from CVS (eg. > 1.1.1) for sql export to work.
+
+ </notes>
+ <state>beta</state>
+ </release>
</changelog>
</package>
Index: pear/Gtk_MDB_Designer/Designer/Column.php
diff -u pear/Gtk_MDB_Designer/Designer/Column.php:1.4 pear/Gtk_MDB_Designer/Designer/Column.php:1.5
--- pear/Gtk_MDB_Designer/Designer/Column.php:1.4 Sat Mar 22 11:28:47 2003
+++ pear/Gtk_MDB_Designer/Designer/Column.php Sat Mar 22 23:29:25 2003
@@ -16,7 +16,7 @@
// | Authors: Alan Knowles <alan@akbkhome.com> |
// +----------------------------------------------------------------------+
//
-// $Id: Column.php,v 1.4 2003/03/22 16:28:47 alan_k Exp $
+// $Id: Column.php,v 1.5 2003/03/23 04:29:25 alan_k Exp $
//
// The column dataobject
//
@@ -92,7 +92,7 @@
break;
case 'pgsql':
case 'oci8': // no idea if this works..
- $r .= " DEFAULT nextval({$this->name}_sequence) ";
+ $r .= " DEFAULT
nextval('{$this->table->name}_{$this->name}_sequence') ";
}
}
return $r;
@@ -152,7 +152,7 @@
return "ALTER TABLE {$this->table->name} ADD {$index}
{$this->name}_index ({$this->name})";
case 'pgsql':
case 'oci8':
- return "CREATE {$unique} INDEX {$this->name}_index on
{$this->table->name} ({$this->name})";
+ return "CREATE {$unique} INDEX
{$this->table->name}_{$this->name}_index on {$this->table->name}
({$this->name})";
}
}
Index: pear/Gtk_MDB_Designer/Designer/Table.php
diff -u pear/Gtk_MDB_Designer/Designer/Table.php:1.5 pear/Gtk_MDB_Designer/Designer/Table.php:1.6
--- pear/Gtk_MDB_Designer/Designer/Table.php:1.5 Sat Mar 22 12:35:41 2003
+++ pear/Gtk_MDB_Designer/Designer/Table.php Sat Mar 22 23:29:26 2003
@@ -16,7 +16,7 @@
// | Authors: Alan Knowles <alan@akbkhome.com> |
// +----------------------------------------------------------------------+
//
-// $Id: Table.php,v 1.5 2003/03/22 17:35:41 alan_k Exp $
+// $Id: Table.php,v 1.6 2003/03/23 04:29:26 alan_k Exp $
//
// The table dataobject
//
@@ -111,12 +111,15 @@
}
$ret .= "\nCREATE TABLE {$this->name} (\n";
+ $begin = ' ';
foreach($this->fields as $field) {
if ($row =$field->toSQL($db)) {
- $ret .= " ". $row. ",\n";
+ $ret .= $begin . $row;
+ $begin = ",\n ";
}
+
}
- $ret .= ")";
+ $ret .= "\n)";
if (strlen($this->inherits)) {
$ret.= "\nINHERITS ({$this->inherits})";
}