Good day,
I have created new entity:
<?php
namespace InveoczCMSEntity;
class BannerCategory implements BannerCategoryInterface
{
/** @var int|null */
protected $id;
/** @return int|null */
public function getId(): ?int
{
return $this->id;
}
}
and xml mapping for it:
<?xml version="1.0" encoding="UTF-8"?>
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:gedmo="http://gediminasm.org/schemas/orm/doctrine-extensions-mapping"
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
<mapped-superclass name="InveoczCMSEntityBannerCategory" table="inveocz_cms_banner_category">
<id name="id" column="id" type="integer">
<generator strategy="AUTO"/>
</id>
</mapped-superclass>
</doctrine-mapping>
There is issues, that doctrine have registered this new entity, but running
doctrine:migration:diff
won't generate any new migration in my project. Before that generating it for any other entity was fine.
Also when I run:
doctrine:schema:validate
both schema and mapping are valid.
Same with:
doctrine:mapping:info
will tell me that my "InveoczCMSEntityBannerCategory" is registered by doctrine.
Symfony: 4.4.18
PHP: 7.4.9
doctrine.yaml:
doctrine:
dbal:
driver: 'pdo_mysql'
server_version: '5.7'
charset: UTF8
url: '%env(resolve:DATABASE_URL)%'
orm:
auto_generate_proxy_classes: '%kernel.debug%'
auto_mapping: true
mappings:
App:
is_bundle: false
type: xml
dir: '%kernel.project_dir%/src/Resources/config/doctrine/model'
prefix: 'AppEntity'
alias: App
dql:
datetime_functions:
date: DoctrineExtensionsQueryMysqlDate
month: DoctrineExtensionsQueryMysqlMonth
year: DoctrineExtensionsQueryMysqlYear
numeric_functions:
round: DoctrineExtensionsQueryMysqlRound
Running:
doctrine:cache:clear-metadata
won't help and droping my docker containers won't help either.
Can anyone give me hint what could possibly be wrong?
Thank much for any help
question from:
https://stackoverflow.com/questions/65830568/doctrine-wont-generate-migration-for-new-entity 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…