Làm thế nào tôi có thể ngừng sử dụng symfony để tạo bảng cho chế độ xem mà tôi đã tạo trên quá trình di chuyển học thuyết?Làm cách nào để ngăn chặn học thuyết cố gắng tạo bảng cho chế độ xem đã được ánh xạ trên thực thể?
Entity lập bản đồ các điểm
/**
* Class TenancyPendingInspection
* @ORM\Entity(repositoryClass="DJABundle\PropertyVisit\Repository\TenancyPendingInspectionRepository", readOnly=true)
* @ORM\Table(name="view_tenancies_pending_inspections")
*/
class TenancyPendingInspection
{
Tôi có cũng như các tập tin thuyết di cư.
thuyết Cấu hình
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.
thuyết schema update
php app/console doc:sch:update --dump-sql
CREATE TABLE view_tenancies_pending_inspections ...
Tôi đã thử ''/^(?! view _) /'' và nó hoạt động như mong đợi. Bạn đã cài đặt phiên bản Doctrine-DBAL nào? – yceruto
Tôi cũng đã cấu hình nó dưới khoá 'dbal: 'trực tiếp. – yceruto
DBAL v2.5.13 Như tôi đã hiểu, bộ lọc này dừng DBAL xem các bảng đó (view_ *) để Doctrine cố gắng tạo bảng mọi lúc – albert