Symfony - 如何在我的学说迁移中插入行为?

发布于 2024-07-17 21:36:40 字数 90 浏览 6 评论 0原文

是否可以在条令迁移中添加行为(例如 actAs Timestampable)以避免定义created_at和updated_at列?

提前致谢 !

Is it possible to add behaviors (eg. actAs Timestampable) in a doctrine migration to avoid defining the created_at and updated_at columns ?

Thank's in advance !

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

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

发布评论

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

评论(2

不必了 2024-07-24 21:36:40

我认为没有办法在迁移代码中添加行为。

但! 如果您使用的是doctrine 1.1(很容易从1.0迁移),您可以修改您的模式,添加行为,并让doctrine生成迁移代码,如下所述:

http://www.doctrine-project.org/blog/new-to-migrations-in-1-1< /a>

I think there is no way to add behaviors in the migration code.

BUT! if you are using doctrine 1.1 (it's easy to migrate from 1.0) you can instead modify your schema, add the behavior, and let doctrine generate the migration code as explained here:

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

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