Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Foreign keys missing in database after Mapping process
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Marco Pivetta  
View profile  
 More options Feb 23 2012, 6:37 am
From: Marco Pivetta <ocram...@gmail.com>
Date: Thu, 23 Feb 2012 12:37:25 +0100
Local: Thurs, Feb 23 2012 6:37 am
Subject: Re: [doctrine-user] Foreign keys missing in database after Mapping process

Why are you defining nulled mappings?
     inversedBy: null ???
Also, you don't need to define
   grade_id:
     type: integer
     length: '10'
     notnull: true
(you don't think in terms of IDs when working with Doctrine ORM!)
nor you need to define:
 indexes:
   fk_players_grades1:
     columns:
       - grade_id
As that should be handled by the ORM if relations are setup correctly.
Marco Pivetta

http://twitter.com/Ocramius

http://marco-pivetta.com

On 23 February 2012 12:34, Renaud <rvi...@gmail.com> wrote:

> Hello,
> I'm new to Doctrine, and this is my first project with it.
> I have a lot of YAML files i processed with :
> orm:generate-entities models
> then
> orm:generate-proxies
> and
> orm:schema-tool:create

> All went fine, no error.  But my MySQL table doesn't have any
> relations : the foreign keys are missing...
> Here are two YAML files:

> Entities\Player:
>  type: entity
>  table: players
>  indexes:
>    fk_players_grades1:
>      columns:
>        - grade_id
>  fields:
>    player_id:
>      id: true
>      type: integer
>      length: '10'
>      notnull: true
>      generator:
>        strategy: AUTO
>    grade_id:
>      type: integer
>      length: '10'
>      notnull: true
>  oneToMany:
>    grade:
>      targetEntity: Grade
>      cascade: {  }
>      mappedBy: players
>      inversedBy: null
>      orphanRemoval: false
>      orderBy: null

> and:

> Entities\Grade:
>  type: entity
>  table: grades
>  fields:
>    grade_id:
>      id: true
>      type: integer
>      length: '10'
>      notnull: true
>      generator:
>        strategy: AUTO

> Any idea why the FK aren't generated ?

> Renaud

> --
> You received this message because you are subscribed to the Google Groups
> "doctrine-user" group.
> To post to this group, send email to doctrine-user@googlegroups.com.
> To unsubscribe from this group, send email to
> doctrine-user+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/doctrine-user?hl=en.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.