Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [Doctrine] unique key
Animax
post
Post #1





Grupa: Zarejestrowani
Postów: 13
Pomógł: 0
Dołączył: 25.12.2011

Ostrzeżenie: (0%)
-----


Nie wiem jak połączyć doctrine z unique key'em.

Tabela wygląda tak:
  1. CREATE TABLE IF NOT EXISTS `player_items` (
  2. `player_id` int(11) NOT NULL DEFAULT '0',
  3. `pid` int(11) NOT NULL DEFAULT '0',
  4. `sid` int(11) NOT NULL DEFAULT '0',
  5. `itemtype` int(11) NOT NULL DEFAULT '0',
  6. `count` int(11) NOT NULL DEFAULT '0',
  7. `attributes` blob NOT NULL,
  8. UNIQUE KEY `player_id_2` (`player_id`,`sid`),
  9. KEY `player_id` (`player_id`)
  10. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;


Próbowałem tak:
  1. /**
  2.   * @Id
  3.   * @Column(unique=true)
  4.   * @Column(type="integer")
  5.   * @Column(name="player_id_2")
  6.   */
  7. private $player_id_2;


No, ale jak widać bezskutecznie, ktoś wie jak to ma wyglądać?
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 22.08.2025 - 11:15