CakePHP 可以自动从模型创建表吗? [英] can CakePHP automatically create tables from models?

查看:37
本文介绍了CakePHP 可以自动从模型创建表吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

In python::Pylons i'm able to issue a setup-app command and it will look at my Models and issue the appropriate CREATE TABLE or CREATE INDEX ddl for my particular database.

it seems like this would be a feature in CakePHP, but i'm having trouble finding it.

in fact i see this in the manual: "You can create your database tables as you normally would. When you create your Model classes, they'll automatically map to the tables that you've created."

which leads me to believe it doesn't exist?

解决方案

No, it's other way around - you can create models, controllers and views by having DB schema. It's more logical to have a DB design schema first.

Check this out

这篇关于CakePHP 可以自动从模型创建表吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆