How I can stop symfony trying to create the table for the view I created on a doctrine migration?
Entity mapping the view
/**
* Class TenancyPendingInspection
* @ORM\Entity(repositoryClass="DJABundle\PropertyVisit\Repository\TenancyPendingInspectionRepository", readOnly=true)
* @ORM\Table(name="view_tenancies_pending_inspections")
*/
class TenancyPendingInspection
{
I have as well the doctrine migration file.
Doctrine Configuration
doctrine:
dbal:
default_connection: default
connections:
default:
[...]
charset: UTF8
server_version: 5.6
schema_filter: ~^(?!view_)~
Doctirne schema validate
php app/console doc:sch:val
[Mapping] OK - The mapping files are correct.
[Database] FAIL - The database schema is not in sync with the current mapping file.
Doctrine schema update
php app/console doc:sch:update --dump-sql
CREATE TABLE view_tenancies_pending_inspections ...
'/^(?!view_)/'
and it work as expected. What version of Doctrine-DBAL are you installed? – Seinedbal:
key directly. – Seine@ORM\Entity
and@ORM\Table
. – Seine