誰かが次の教義スキーマ検証エラーメッセージを説明できますか?
これは、manyToMany関係の各エンティティのyaml ORM定義であり、ドキュメントのセクション5.9に沿って作成されています。
Rep\Bundle\ProjectBundle\Entity\User:
type: entity
table: User
fields:
id:
id: true
type: integer
unsigned: true
nullable: false
generator:
strategy: AUTO
username:
type: string
length: 25
fixed: false
nullable: false
salt:
type: string
length: 32
fixed: false
nullable: false
password:
type: string
length: 40
fixed: false
nullable: false
email:
type: string
length: 60
fixed: false
nullable: false
manyToMany:
roles:
targetEntity: UserRole
inversedBy: users
joinTable:
name: UserRoleLookup
joinColumns:
user_id:
referencedColumnName: id
inverseJoinColumns:
user_role_id:
referencedColumnName: id
lifecycleCallbacks: { }
そして、UserRoleの逆yaml構成:
Rep\Bundle\ProjectBundle\Entity\UserRole:
type: entity
table: UserRole
fields:
id:
id: true
type: integer
unsigned: true
nullable: false
generator:
strategy: AUTO
name:
type: string
length: 50
fixed: false
nullable: false
manyToMany:
users:
targetEntity: User
mappedBy: roles
lifecycleCallbacks: { }
Userテーブルスキーマは次のとおりです。
CREATE TABLE `User` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`username` varchar(25) COLLATE utf8_unicode_ci NOT NULL,
`salt` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
`password` varchar(40) COLLATE utf8_unicode_ci NOT NULL,
`email` varchar(60) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
UserRoleテーブルスキーマ:
CREATE TABLE `UserRole` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
そして、UserRoleLookupスキーマ:
CREATE TABLE `UserRoleLookup` (
`user_id` int(11) unsigned NOT NULL,
`user_role_id` int(11) unsigned NOT NULL,
PRIMARY KEY (`user_id`,`user_role_id`),
KEY `user_role_id` (`user_role_id`),
CONSTRAINT `userrolelookup_ibfk_2` FOREIGN KEY (`user_role_id`) REFERENCES `userrole` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `userrolelookup_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ご覧のとおり、これは、特定のユーザーロール内のユーザーのロールまたはユーザーのセットを指定するためのルックアップテーブルを備えた非常に単純なセットアップです。ただし、このイライラする同期エラーが発生します。私はここやオンラインでこの質問に簡潔に答えるものを何も読んでいません。この構成をそのままにしてこのエラーを無視しても安全かどうかを誰かが明確にできることを望んでいましたか?