alvinphp wrote:Hockey wrote:Anyone know of a PHP tool which looks at your MySQL database tables and determines relationships automagically via some convention like:
users:
pkid, fname, lname
members:
pkid, users_pkid, email, phone1, phone2
Now a system could generate some UML diagram indicating that
members had a psuedo foriegn key linking it to
users table...
Get what I'm asking? A tool in PHP for MySQL tables that does this?
Cheers

A little off subject, buuuut the point of UML is not to document everything after the tables are built. You are 'supposed' to build your UML first so you can see how your table model looks before you develop. This way you find problems before you start developing. And it is astronomically easier to fix a problem before coding then it is halfway through the project. So even if a tool did exist to document the entity relationships, it should really only be used if you took over someones project and they had no documentation.
So what then, would you suggest be used to indicate table relationships??? If not UML, what?
Everah wrote:I have never looked into it, but does
phpMyAdmin have any functions similar to what you are looking for?
I have the latest version, but I can't find anything, mind you I have looked very hard
timvw wrote:http://www.fabforce.net/dbdesigner4/.
<off-topic->
UML is a set of languages that allow you to make a representation of a 'system'.
Yes, there are people that swear to use it upfront, and there are people that decide to generate models afterwards in order to make documentation easier... It all depends on *your* needs..
</off-topic>
Thank you
alvinphp wrote:timvw wrote:
<off-topic->
UML is a set of languages that allow you to make a representation of a 'system'.
Yes, there are people that swear to use it upfront, and there are people that decide to generate models afterwards in order to make documentation easier... It all depends on *your* needs..
</off-topic>
<off-topic->
So, are you saying that sometimes it is better to do all your documentation after coding and no planning should be done? Do you just jump into coding and then fix as problems arise?
</off-topic->
Your missing the point...
I needed some tool and representation of how my tables were related, if at all...
So when I change my model for one table I can look at a UML diagram and quickly figure out what other tables might need be updated...
Which, beats the hell out of updating one model...testing the system 2 weeks later only to learn the hard way (something not working because of improper table relations).
alvinphp wrote:arborint wrote:alvinphp wrote:
<off-topic->
So, are you saying that sometimes it is better to do all your documentation after coding and no planning should be done? Do you just jump into coding and then fix as problems arise?
</off-topic->
<off-topic->
In some ways you are describing the spirit and essence of Agile Methologies which are the current cutting edge of development practices. So I vote yes.
</off-topic->
Agile is a very good methodology, but it is not zero planning. You just do not need very much as you are building a very small amount at a time. Agile should not be used as an excuse not to do any planning, especially if you are doing a 3 month project (which would then go against the heart of Agile methodology).
At the most basic you want to at least know the tables you want along with their relationship and a list of the functions you will need. So when I say documentation I am not talking 160 pages of mostly useless stuff, I'm talking rapid development methodology type documentation.
I have all that hammered out already, but like I said before...
Maybe I need it so in the future as my table relationships change I don't have to update my docs, but use a tool which generates reltionships for me...
Kind of like documentation in comments...it just makes sense
Jcart | Yes, we DO have an edit button.