RE: [PEAR] MDB: reverse engineer schema
| From: | Lukas Smith | Date: | Thu, 20 Mar 2003 12:10:24 +0000 |
| Subject: | RE: [PEAR] MDB: reverse engineer schema | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-4331@lists.php.net to get a copy of this message | ||
> From: Jeroen Houben [mailto:jeroen@terena.nl]
> Sent: Thursday, March 20, 2003 12:27 PM
> To: PEAR
> Subject: [PEAR] MDB: reverse engineer schema
>
> Hi,
>
> I just tried to reverse engineer my MySql DB structure and got some
> warnings:
>
> Long (1)
>
> Warnings
>
> 0 String[287] (There are 2 type choices in the table sections field
> urltarget (#1 is the default): choice #1:
>
a:4:{s:4:"type";s:4:"text";s:7:"notnull";i:1;s:7:"default";s:5:"_self";s
:6
> :"length";i:6;}choice #2:
>
a:4:{s:4:"type";s:7:"integer";s:7:"notnull";i:1;s:7:"default";s:5:"_self
";
> s:6:"length";i:6;})
> 1 String[283] (There are 2 type choices in the table permissions field
> perm (#1 is the default): choice #1:
>
a:4:{s:4:"type";s:4:"text";s:7:"notnull";i:1;s:7:"default";s:4:"READ";s:
6:
> "length";i:5;}choice #2:
>
a:4:{s:4:"type";s:7:"integer";s:7:"notnull";i:1;s:7:"default";s:4:"READ"
;s
> :6:"length";i:5;})
> 2 String[238] (There are 2 type choices in the table docblobs field
> content (#1 is the default): choice #1:
>
a:3:{s:4:"type";s:4:"blob";s:7:"notnull";i:1;s:7:"default";s:0:"";}choic
e
> #2:
a:3:{s:4:"type";s:4:"text";s:7:"notnull";i:1;s:7:"default";s:0:"";})
>
> It still dumps the DB structure nicely, but how can I chose a type and
> get an actual XML file out of this? Right now the file created is 0
bytes.
The problem with reverse engineering of schema files is that it is not
1-to-1. That is in same cases it is impossible to automatically guess
what type to use.
For example a CHAR(1) in mysql may be a TEXT(1) or a BOOLEAN.
Therefore the manager tries a best guess and issues the other
alternatives as a warning. If you want the alternative you have to
manually do it.
The plan was to someday have an interactive tool that will ask what you
want. This was part of the goal of the MDB_Frontend project, which is
currently orphaned however.
Regards,
Lukas