【发布时间】:2021-12-31 11:11:27
【问题描述】:
我正在使用 OroCrm 创建我的自定义实体。我创建了自己的捆绑包 SmartMedCRMNewBundle。
<?php
namespace SmartMed\Bundle\CRMNewBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class SmartMedCRMNewBundle extends Bundle{}
在我在捆绑包下创建了我自己的实体 CustomEntity 之后
<?php
namespace SmartMed\Bundle\CRMNewBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Oro\Bundle\AccountBundle\Entity\Account;
use Oro\Bundle\EntityConfigBundle\Metadata\Annotation\Config;
use Oro\Bundle\EntityConfigBundle\Metadata\Annotation\ConfigField;
use Oro\Bundle\UserBundle\Entity\User;
/**
* @ORM\Entity(repositoryClass=CustomEntityRepository::class)
* @ORM\Table(name="custom_entity")
* @ORM\HasLifecycleCallbacks()
*/
class CustomEntity
{
/**attributes**/
}
在我使用命令php bin/console oro:migration:dump --bundle=SmartMedCRMNewBundle > SmartMedCRMNewBundleInstaller.php 在 SmartMed\Bundle\CRMNewBundle\Migrations\Schema 下创建安装程序之后。
成功生成安装程序后,我执行了命令php bin/console oro:migrations:load --force,它成功加载了我的安装程序。
现在,当我想在我的实体和数据库中进行更新时,我发现自己有义务编写自己的迁移代码来负责更新。
我想知道是否有其他方法可以像在教义/迁移中那样自动生成这些迁移。
我正在使用 OroCrm 4.2.7 版
【问题讨论】: