title: ALTER TABLE add constraint
body: <p>The tables User and Properties were created properly</p>
  <pre><code>CREATE TABLE Properties
  (
      ID int AUTO_INCREMENT,
      language int,
      stonecolor int,
      gamefield int,
      UserID int,
      PRIMARY KEY(ID),
      FOREIGN KEY(language) REFERENCES Language(ID),
      FOREIGN KEY(stonecolor) REFERENCES StoneColor(ID),
      FOREIGN KEY(gamefield) REFERENCES GameField(ID)
  ) ENGINE = INNODB;
  
  CREATE TABLE User
  (
      ID int AUTO_INCREMENT,
      vorname varchar(30) NOT NULL,
      name varchar(30) NOT NULL,
      email varchar(40) NOT NULL,
      password varchar(40) NOT NULL,
      nickname varchar(15) NOT NULL,
      score int,
      isadmin int DEFAULT 0,
      gamesPlayed int,
      properties int NOT NULL,
      PRIMARY KEY(ID),
      UNIQUE (email),
      UNIQUE (nickname)
  
  ) ENGINE = INNODB;
  </code></pre>
  <p>But <code>ALTER TABLE User</code> doesn't work.</p>
  <pre><code>ALTER TABLE User 
  (
      ADD CONSTRAINT userPropertie
      FOREIGN KEY(properties)
      REFERENCES Properties(ID)
  )
  </code></pre>
  <p>Can't figure out why?</p>
  <p>I used this as reference <a href="http://www.w3schools.com/sql/sql_foreignkey.asp" rel="nofollow noreferrer">http://www.w3schools.com/sql/sql_foreignkey.asp</a></p>
  <blockquote>
  <p>Error 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(
  ADD CONSTRAINT userPropertie
  FOREIGN KEY(properties)
  REFERENCES Properties(' at line 2</p>
  </blockquote>