Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Can't create table. InnoDB, problem z FOREIGN KEY?
rafalp
post
Post #1





Grupa: Zarejestrowani
Postów: 224
Pomógł: 18
Dołączył: 4.02.2003
Skąd: Częstochowa

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


  1. CREATE TABLE friends (
  2. FK_user_id BIGINT NOT NULL,
  3. FK_friend_id BIGINT NOT NULL,
  4. STATUS TINYINT UNSIGNED NULL DEFAULT 0,
  5.  
  6. FOREIGN KEY(FK_user_id)
  7. REFERENCES users(user_id) ON DELETE CASCADE ON UPDATE CASCADE,
  8. FOREIGN KEY(FK_friend_id)
  9. REFERENCES users(user_id) ON DELETE CASCADE ON UPDATE CASCADE
  10. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;


#1005 - Can't create table '.\folder\friends.frm' (errno: 150)

Bez "ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;" -działa.

Dodam że typy pól FK_user_id - user_id są takie same oraz z "PRIMARY KEY ( FK_user_id )" także nie działa

Ten post edytował rafalp 14.11.2008, 16:47:51
Go to the top of the page
+Quote Post

Posty w temacie


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

 



RSS Aktualny czas: 16.10.2025 - 02:57