从现有的 MySQL 数据库生成 ER 图表,为 CakePHP 创建
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4326377/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Generate ER Diagram from existing MySQL database, created for CakePHP
提问by user198003
For CakePHP application, I created MySQL database.
对于 CakePHP 应用程序,我创建了 MySQL 数据库。
Which tool to be used to create ER Diagram of database? Fields and relations between tables are created in a way cakePHP likes.
用什么工具来创建数据库的ER图?表之间的字段和关系以 cakePHP 喜欢的方式创建。
thank you in advance!
先感谢您!
采纳答案by RabidFire
Try MySQL Workbench. It packs in very nice data modeling tools. Check out their screenshotsfor EER diagrams (Enhanced Entity Relationships, which are a notch up ER diagrams).
试试MySQL 工作台。它包含非常好的数据建模工具。查看他们的 EER 图(增强的实体关系,这是一个 ER 图)的屏幕截图。
This isn't CakePHP specific, but you can modify the options so that the foreign keys and join tables follow the conventions that CakePHP uses. This would simplify your data modeling process once you've put the rules in place.
这不是 CakePHP 特定的,但您可以修改选项,以便外键和连接表遵循 CakePHP 使用的约定。一旦您制定了规则,这将简化您的数据建模过程。
回答by varun249
Use MySQL Workbench. create SQL dump file of your database
使用MySQL 工作台。创建数据库的 SQL 转储文件
Follow below steps:
请按照以下步骤操作:
- Click File->Import->Reverse Engineer MySQL Create Script
- Click Browse and select your SQL create script.
- Make Sure "Place Imported Objects on a diagram" is checked.
- Click Execute Button.
- You are done.
- 点击 File->Import->Reverse Engineer MySQL Create Script
- 单击浏览并选择您的 SQL 创建脚本。
- 确保选中“在图表上放置导入的对象”。
- 单击执行按钮。
- 你完成了。
回答by Suman
If you don't want to install MySQL workbench, and are looking for an online tool, this might help: http://ondras.zarovi.cz/sql/demo/
如果您不想安装 MySQL 工作台,并且正在寻找在线工具,这可能会有所帮助:http: //ondras.zarovi.cz/sql/demo/
I use it quite often to create simple DB schemas for various apps I build.
我经常使用它为我构建的各种应用程序创建简单的数据库模式。
回答by Aleksandar Pavi?
CakePHP was intended to be used as Ruby on Rails framework clone, done in PHP, so any reverse-engineering of underlying database is pointless. EER diagrams should be reverse-engineered from Model layer.
CakePHP 旨在用作 Ruby on Rails 框架克隆,在 PHP 中完成,因此任何底层数据库的逆向工程都是毫无意义的。EER 图应该从模型层逆向工程。
Such tools do exist for Ruby Here you can see Redmine database EER diagrams reverse-engineered from Models. Not from database. http://redminecookbook.com/Redmine-erd-diagrams.html
Ruby 确实存在这样的工具在这里您可以看到从模型逆向工程的 Redmine 数据库 EER 图。不是来自数据库。 http://redminecookbook.com/Redmine-erd-diagrams.html
With following tools: http://rails-erd.rubyforge.org/http://railroady.prestonlee.com/
使用以下工具:http: //rails-erd.rubyforge.org/ http://railroady.prestonlee.com/