Symfony2 ACL和Doctrine2:数据库从不与当前实体元数据同步
在我的Symfony2 ACL和Doctrine2:数据库从不与当前实体元数据同步,doctrine,doctrine-orm,acl,symfony-2.1,Doctrine,Doctrine Orm,Acl,Symfony 2.1,在我的config.yml文件中,我基本上有两种不同的条令连接:默认(开发、生产环境)和测试(对于我的测试套件)。以下是我的默认连接配置: # Doctrine Configuration doctrine: dbal: default_connection: default connections: default: driver: %database_driver%
config.yml
文件中,我基本上有两种不同的条令连接:默认(开发、生产环境)和测试(对于我的测试套件)。以下是我的默认连接配置:
# Doctrine Configuration
doctrine:
dbal:
default_connection: default
connections:
default:
driver: %database_driver%
host: %database_host%
port: %database_port%
dbname: %database_name%
user: %database_user%
password: %database_password%
charset: UTF8
orm:
default_entity_manager: default
auto_generate_proxy_classes: %kernel.debug%
entity_managers:
default:
connection: default
metadata_cache_driver: array
query_cache_driver: array
result_cache_driver: array
mappings:
[my bundles here..]
在mysecurity.yml
config中,我为默认连接注册了ACL:
security:
acl:
connection: default
现在,我的问题是:
当我运行这些命令时
./app/console doctrine:database:drop --connection=default --force
./app/console doctrine:database:create --connection=default
./app/console doctrine:schema:create --em=prod
我已经创建了5个与ACL相关的表。额外命令
./app/console init:acl
导致中止:名为“myproject\u prod.acl\u classes”的表已存在。
然后,稍后,如果我执行/app/console原则:schema:update--dumpsql--env=prod
,它将导致
ALTER TABLE acl_classes CHANGE id id INT UNSIGNED AUTO_INCREMENT NOT NULL;
ALTER TABLE acl_security_identities CHANGE id id INT UNSIGNED AUTO_INCREMENT NOT NULL;
ALTER TABLE acl_object_identities CHANGE id id INT UNSIGNED AUTO_INCREMENT NOT NULL, CHANGE parent_object_identity_id parent_object_identity_id INT UNSIGNED DEFAULT NULL, CHANGE class_id class_id INT UNSIGNED NOT NULL;
ALTER TABLE acl_object_identity_ancestors CHANGE object_identity_id object_identity_id INT UNSIGNED NOT NULL, CHANGE ancestor_id ancestor_id INT UNSIGNED NOT NULL;
ALTER TABLE acl_entries CHANGE id id INT UNSIGNED AUTO_INCREMENT NOT NULL, CHANGE security_identity_id security_identity_id INT UNSIGNED NOT NULL, CHANGE object_identity_id object_identity_id INT UNSIGNED DEFAULT NULL, CHANGE class_id class_id INT UNSIGNED NOT NULL, CHANGE ace_order ace_order SMALLINT UNSIGNED NOT NULL
我可以使用——强制来做这些请求,结果总是一样的。表在这里,外键可以,但条令总是认为它与元数据不同步
我不知道这是否有问题,因为在我的应用程序中,一切都是完美的功能,ACL工作得很好,但当我更新我的模式或验证它以看到这种情况时,我感到有点沮丧
在此方面的帮助将不胜感激
谢谢
编辑:我使用的是Symfony2.1rc4,同样的事情也发生在我身上,也运行的是2.1rc4 每当我添加一个实体,生成getter/setter,然后用--force执行一个更新模式时,我也会得到这5个执行
到目前为止,我忽略了它,到目前为止它还没有引起任何问题。同样的事情也发生在我身上,也运行2.1 rc4 每当我添加一个实体,生成getter/setter,然后用--force执行一个更新模式时,我也会得到这5个执行
到目前为止,我忽略了它,到目前为止,它还没有引起任何问题。似乎这个问题在这里得到了重视:
很快就解决了,我想:)这里的问题似乎已经被认真对待了: 我想很快就好了:)