将 Doctrine 1 模式转换为 Doctrine 2 实体?
几个月前,有一个命令将条令 1 模式文件转换为条令 2 实体,但是,该命令不再存在。
我刚刚开始使用 Symfony2 RC1。
被删除有原因吗?我有一个原则 1 模式文件,有 600 行 YML...拥有一个转换工具将非常有用。
A few months ago there was a command to convert a doctrine 1 schema file to doctrine 2 entities, however, this command no longer exists.
I've just start using the Symfony2 RC1.
Is there a reason it was removed? I have a doctrine 1 schema file which is 600 lines of YML... having a conversion tool would be incredibly useful.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
做这样的转换是很困难的。这是因为您没有版本 2 中的原则 1 的行为(可时间戳、可版本化...),
但您始终可以使用现有数据库中的原则:映射:导入命令行任务来创建实体。
it is difficult to do such a conversion. This is because you don't have the behaviours of Doctrine 1 in Version 2 (Timestampable, Versionable...)
But you can always create your Entities with the doctrine:mapping:import commandline task from your existing database.
我相信您需要手动复制主义 bin 文件,因为它们默认情况下不随 Symfony2 一起提供。
请参阅http://www.doctrine-project.org/ docs/orm/2.1/en/reference/tools.html
I believe that you need to manually copy the doctrine bin files since they don't come with Symfony2 by default.
See http://www.doctrine-project.org/docs/orm/2.1/en/reference/tools.html