升级到symfony 6.0 且调整到php 8之后,遇到如下问题
$ symfony console make:migration -vvv
In NoMappingFound.php line 13:
[Doctrine\Migrations\Provider\Exception\NoMappingFound]
No mapping information to process
In NoMappingFound.php line 13:
[Doctrine\Migrations\Provider\Exception\NoMappingFound]
No mapping information to process
实体代码
#[ORM\Entity(repositoryClass: ThirdRecordRepository::class)]
#[ORM\Table(name: "third_record")]
class ThirdRecord
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private int $id;
}
#[ORM\Table(name: "third_record")]
class ThirdRecord
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private int $id;
}
配置
App:
is_bundle: false
dir: '%kernel.project_dir%/src/Entity/App'
prefix: 'App\Entity\App'
type: annotation
alias: App
is_bundle: false
dir: '%kernel.project_dir%/src/Entity/App'
prefix: 'App\Entity\App'
type: annotation
alias: App
最终解决:
https://github.com/symfony/maker-bundle/issues/960
修正后的配置
App:
is_bundle: false
dir: '%kernel.project_dir%/src/Entity/App'
prefix: 'App\Entity\App'
type: attribute
alias: App
is_bundle: false
dir: '%kernel.project_dir%/src/Entity/App'
prefix: 'App\Entity\App'
type: attribute
alias: App
主要调整:更新到PHP8之后使用了PHP属性注解,需要调整type: annotation
为type: attribute
当前还没有任何评论