Hi,

Thanks for help, If you clarify just this I'd be fine.
The FK of an owning side of a OneToOne relation is primary key of that
table but not auto-incrementing.
In the Entity there is GENERATOR_TYPE_IDENTITY, when I run update schema,
it forces the primary key to be auto-incrementing, but FK should not be
auto-incrementing!
So I was thinking of two ways:

1) output update schema to a file and remove that line to not change FK as
auto_increment and leave GENERATOR_TYPE_IDENTITY intact.

2) Change GENERATOR_TYPE_IDENTITY to GENERATOR_TYPE_NONE that update schema
doesn't change it to auto_incrementing. but when adding a new entity it
throws error that identifer is not populated, so instead of:
$blah->setProduct($product) to add the id of product in that entity use
this:
$blah->setId($product->getId());

Which one of these two ways do you recommend or what else do you recommend?
I appreciate your advice about this, as my script is almost 99% ready to go
and I'd be less annoying in this list from now on! :))






On Thu, Jun 5, 2014 at 2:01 AM, Nima Sadjadi <[email protected]> wrote:

> As you know MySql gives error 150 if we want to add constraint fk index to
> fk cols if that fk is not unsigned! I don't understand why MySql forces fk
> to be unsigned and not simply "int"?
> As you said the only way is setting them as unsigned manually. So i did
> output schema update to file, remove the lines that want to change unsigned
> fk, copy/paste add constraint fk and add index to mysql console...
>

-- 
You received this message because you are subscribed to the Google Groups 
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to