您可以使用 Doctrine 从现有表生成迁移吗?

发布于 2024-07-09 11:39:01 字数 286 浏览 5 评论 0原文

是否可以从 Doctrine 中的表模式自动生成迁移脚本?

例如,在新功能的大量开发过程中,我通常会在编写初始代码时首先构建我的表。 我通常不会创建迁移来开始,因为表的定义可能会发生变化,因为该功能仍处于婴儿阶段。 一旦该功能准备好提交,我将编写一个迁移来生成新功能的表结构。 通常,会有几张新桌子。

你可以说我很懒,但如果能够自动构建这些迁移那就太棒了。

例如:

学说 build-migration table_name

是否存在可以完成这样的事情?

Is it possible have a migration script automatically generate from a table schema in Doctrine?

For example, during heavy development of new features, I will oftern build out my tables first while writing the initial code. I usually don't create a migration to start because the definition of the table may change as the feature is still in its infant stages. Once the feature is ready to commit I will write a migration to generate the table structure for the new feature. Often, there will be several new tables.

Call me lazy but it would be awesome if could have those migrations built automagically.

For example:

doctrine build-migration table_name

Does something exist to accomplish something like this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

溺深海 2024-07-16 11:39:01

这个(或类似的东西)存在于 Doctrine 1.1 中,您可以从 Doctrine 站点获取预览版本。

看:
http://www.doctrine-project.org/博客/new-to-migrations-in-1-1

This (or something like it) is present in Doctrine 1.1, you can get a preview version from the doctrine site.

See:
http://www.doctrine-project.org/blog/new-to-migrations-in-1-1

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文