![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 1 640 Pomógł: 28 Dołączył: 13.02.2003 Skąd: Międzyrzecz/Poznań Ostrzeżenie: (0%) ![]() ![]() |
Probuje stworzyc relacje w ten sposob:
Kod Article hasOne User User hasMany Article User hasMany Comments Articles hasMany Comments Tabela 'comments' chcialbym zeby wygladala mniej wiecej tak: Kod id content user_id model foreign_key ... Przykladowe wiersze w tabeli 'comments': Kod 1, 'Witaj kolego!' 123, User, 3 // user_id=123 dodal komentarz do uzytkownika o id=3 2, 'Dobry artykul!', 234, Article, 42 // user_id=234 dodal komentarz do artykulu o id=42 Czy to jest dobry sposob dla tabeli 'comments', dobre rozumowanie. I w jaki sposob mialby dzialac model Comment? Ten post edytował kicaj 10.01.2009, 02:30:52 |
|
|
![]() |
![]()
Post
#2
|
|
Grupa: Zarejestrowani Postów: 274 Pomógł: 54 Dołączył: 2.05.2006 Skąd: Nadarzyn Ostrzeżenie: (0%) ![]() ![]() |
no to ok, wiec zrobil bym to tak
Kod tabela comments --------------- id content model model_id i teraz tak
i tak samo dla userow a model Comment
|
|
|
![]() ![]() |
![]() |
Aktualny czas: 13.10.2025 - 23:31 |