如何在 PHP 中处理数据库/表更改?
好吧,现在我遇到这个问题,我需要为我的用户表添加一个“余额”列。我正在使用 Zend 框架,我希望在这里使用这个框架:
不幸的是我想它从来没有进入实现阶段,只有头文件,imeplementation文件无处可下载。
你们有什么建议吗?我不想转到 5 mysql 数据库并手动添加我需要的列 - 同时我不想每次需要进行任何数据库更改时都这样做。我需要类似 zend 模式管理器组件的东西。
Ok so now I have this problem i need to add a "balance" column for my users table. I am using the Zend framework and I was hoping to use this one here:
Unfortunately i suppose it never got into the implementation stage and there's just the header file, the imeplementation file is nowhere to be downloaded.
Would you guys have any suggestion? I don't want to go to 5 mysql database and add manually the column i need - at the same time i don't want to be doing it this way everytime i need to make any db changes. I need something like the zend schema manager component.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我目前正在使用 Akrabat_Db_Schema_Manager 作为数据库迁移工具。它是用
Zend Framework
编写的,非常简单,所有数据库更改都应该用原始SQL
编写。您还可以查看Doctrine 迁移工具。它允许您仅使用 Doctrine 对象来编写迁移,从而跳过编写原始 SQL 部分。但不确定
Doctrine 2.0
是否存在。更多见解此处。
I'm currently using Akrabat_Db_Schema_Manager as a database migration tool. It's written in
Zend Framework
and is pretty straightforward, all database changes should be written in rawSQL
.You can also take a look at Doctrine Migration Tool. It allows you to write migrations using only
Doctrine
objects, thus skipping writing rawSQL
part. Not sure if it exists forDoctrine 2.0
though.More insights here.