symfonyがdoctrineの移行で作成したビュー用のテーブルを作成しようとするのを止める方法はありますか?doctrineがエンティティにマップされたビュー用のテーブルを作成しようとするのを止めるには?
エンティティマッピングビュー
/**
* Class TenancyPendingInspection
* @ORM\Entity(repositoryClass="DJABundle\PropertyVisit\Repository\TenancyPendingInspectionRepository", readOnly=true)
* @ORM\Table(name="view_tenancies_pending_inspections")
*/
class TenancyPendingInspection
{
私だけでなく教義移行ファイルを持っています。
教義設定
doctrine:
dbal:
default_connection: default
connections:
default:
[...]
charset: UTF8
server_version: 5.6
schema_filter: ~^(?!view_)~
DoctirneスキーマあなたがsetFilterSchemaAssetsExpressionを使用することができるはず
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のスキーマの更新
php app/console doc:sch:update --dump-sql
CREATE TABLE view_tenancies_pending_inspections ...
私は '/ ^(?! view _)/ ''を試しましたが、期待どおりに動作しています。 Doctrine-DBALのどのバージョンをインストールしましたか? – yceruto
私は 'dbal:'キーの下で直接設定しました。 – yceruto
DBAL v2.5。13このフィルタはDBALがそのテーブル(view_ *)を見るのを止めるので、Doctrineは常にテーブルを作成しようとします – albert