This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use the new forum.
Home » support » General discussion » Relation not created in next example. Why?
Relation not created in next example. Why? [message #97287] Tue, 13 April 2010 21:32 Go to next message
websku
Messages: 11
Registered: March 2010
Junior Member
I have next two tables. When I run doctrine:build-sql the foreign key is not added. Why?

ClientSetting:
  tableName: client_setting
  columns:
    client_id:
      type: integer(4)
      primary: true
      unsigned: true
      notnull: true
    newsletter:
      type: integer(1)
      unsigned: true
  relations:
    Client:
      class: Client
      local: client_id
      foreign: id
      foreignAlias: ClientSetting
      onDelete: cascade
      onUpdate: cascade
Client:
  columns:
    id:
      type: integer(4)
      primary: true
      unsigned: true
      notnull: true
      autoincrement: true
    email:
      type: string(45)
      unique: true
      notnull: true
    password:
      type: string(255)


It only generates this:
CREATE TABLE client (id INT UNSIGNED AUTO_INCREMENT, email VARCHAR(45) NOT NULL UNIQUE, password VARCHAR(255), PRIMARY KEY(id)) ENGINE = INNODB;
CREATE TABLE client_setting (client_id INT UNSIGNED, newsletter TINYINT UNSIGNED, PRIMARY KEY(client_id)) ENGINE = INNODB;

[Updated on: Tue, 13 April 2010 21:33]

Re: Relation not created in next example. Why? [message #97331 is a reply to message #97287 ] Wed, 14 April 2010 11:11 Go to previous message
halfer  is currently offline halfer
Messages: 9535
Registered: January 2006
Location: West Midlands, UK
Faithful Member
Probably best to direct replies here - duplicate question?

http://forum.symfony-project.org/index.php/m/97323/


Remember Palestine
Previous Topic:increse video upload size
Next Topic:Newbie Form help
Goto Forum:
  

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software