Welcome Guest, Not a member yet? Register   Sign In
how to named table name?
#1

[eluser]sankai[/eluser]
The relationship "One user has many book and one book has one user"
I try create tables as follow:

users
users_books <- error!(Table'testDB.users_books' doesn't exist)
books


users
books_users <- right!
books



so,I try to change the relationship "One user has one book and book has many user" to test.


users
users_books <- error!(Table'testDB.users_books' doesn't exist)
books


users
books_users <- right!
books


it got the same result,why?
#2

[eluser]Future Webs[/eluser]
it should not matter how you name your tables.

its your own preference

if you setting up a many to many table the table that joins the other two should just contain the two primary key names

Code:
users
- user_id
- user_name

books
- book_id
- book_name

users_books
- ub_book_id
- ub_user_id
#3

[eluser]sankai[/eluser]
[quote author="w3bm" date="1227222062"]it should not matter how you name your tables.

its your own preference

if you setting up a many to many table the table that joins the other two should just contain the two primary key names

Code:
users
- user_id
- user_name

books
- book_id
- book_name

users_books
- ub_book_id
- ub_user_id
[/quote]

I got it!
thand you,w3bm.

:gulp: the topic on incorrect board,again.
sorry to admin!plz,move to the DataMapper board :down:




Theme © iAndrew 2016 - Forum software by © MyBB