I have this entities
namespace Model;
/**
* @Entity
* @Table (name="usr_users")
* @Entity(repositoryClass="Repository\UsersRepository")
*/
class Users
{
/**
* @Id
* @Column(type="integer")
* @GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @Column(type="string", length=150, nullable=false)
*/
protected $username;
/**
* @Column(type="string", length=150, nullable=false)
*/
protected $email;
/**
* @Column(type="string", nullable=false)
*/
protected $password;
/**
* @Column(type="datetime", nullable=false)
*/
protected $created_at;
/**
* @Column(type="datetime", nullable=false)
*/
protected $update_at;
/**
* @Column(type="string", length=1, nullable=false)
*/
protected $status;
/**
* @OneToMany(targetEntity="Contacts", mappedBy="user_id")
*/
private $contactUsers;
/*.....*/
<?php
namespace Model;
/**
* @Entity(repositoryClass="Repository\ContactsRepository")
* @Table (name="usr_contacts")
*/
class Contacts
{
/**
* @Id @Column(type="integer")
* @GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @ManyToOne(targetEntity="Users", inversedBy="contactsUsers")
* @JoinColumn(name="user_id", referencedColumnName="id")
* @Column(type="integer")
*/
protected $user_id;
When I will to generate a dump, it create a table dump, but don't add
the foreign key
What is wrong?
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en