Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [ZendFramework][ZF2] Doctrine 2 generowanie Entites z DB
netvalue
post
Post #1





Grupa: Zarejestrowani
Postów: 199
Pomógł: 2
Dołączył: 9.06.2008

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


Cześć

Po przez doctrine-module orm:conver-mapping -from data-base , próbuje wygenerowac Entites ale otrzymuje blad

  1. Table category_product has no primary key.


moje tabel sql:
  1. CREATE TABLE IF NOT EXISTS `category_product` (
  2. `id_category` int(11) NOT NULL,
  3. `id_product` int(11) NOT NULL
  4. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  5.  
  6. CREATE TABLE IF NOT EXISTS `product` (
  7. `id_product` int(11) NOT NULL AUTO_INCREMENT,
  8. `name` varchar(255) CHARACTER SET utf8 NOT NULL,
  9. PRIMARY KEY (`id_product`),
  10. KEY `product_name` (`name`)
  11. ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;



Niestety nie moge ustawić primary key w tabeli category_product poniewaz sa tam rekordy np:

id_category | id_product
2 | 3
2 | 4
10| 3


Co moge zrobic w takim przypadku ?
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: 21.08.2025 - 22:19