php - Symfony 3 - Doctrine 2.5 composite primary key not import -
i trying make mapping:import composite keys.
problem table composite key not imported.
here sql example:
create database composite_key; use composite_key; create table company ( id_company int not null auto_increment, name varchar(200) null, primary key (id_company) ); create table users ( id_user int not null auto_increment, name varchar(200) null, primary key (id_user) ); create table reference ( id_company int not null, id_user int not null, primary key (id_company,id_user), foreign key (id_company) references company(id_company), foreign key (id_user) references users(id_user) ); insert users (`name`) values ('test1'); insert users (`name`) values ('test2'); insert users (`name`) values ('test3'); insert company (`name`) values ('company1'); insert company (`name`) values ('company2'); insert company (`name`) values ('company3'); insert reference (`id_company`,`id_user`) values (1,1); insert reference (`id_company`,`id_user`) values (2,2); insert reference (`id_company`,`id_user`) values (3,3);
result execute query
after have create new symfony project without problems. proceded make import next comands
generating data
php bin/console generate:bundle --namespace=compositebundle --format=yml php bin/console doctrine:mapping:import compositebundle php bin/console doctrine:generate:entities compositebundle
finally have result:
it creates users , company entities.
somone know why of this?
if need entities , yml post them. i'm not posting them beacause post getting long.
Comments
Post a Comment