Symfony - 如何在我的学说迁移中插入行为?
是否可以在条令迁移中添加行为(例如 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为没有办法在迁移代码中添加行为。
但! 如果您使用的是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
仅供参考
http://groups.google.com/group/doctrine-用户/browse_thread/thread/5957eb2ad2dcb407#
FYI
http://groups.google.com/group/doctrine-user/browse_thread/thread/5957eb2ad2dcb407#