List:General Discussion« Previous MessageNext Message »
From:Tobias Asplund Date:January 2 2004 11:56am
Subject:Re: Multiple Roles
View as plain text  
On Fri, 2 Jan 2004, Caroline Jen wrote:

> In case that a user has multiple roles; for example,
> John Dole is both author and editor,
>
> 1. I should have two rows for John Dole?
>
>    John Dole     author
>    John Dole     editor
>
>    or. I should have only one row and use comma ',' to
>
>    separate the roles?
>
>    John Dole     author, editor
>
> 2. How do I create the table for the second case (see
> below)?
>
>   create table user_roles (
>   user_name     varchar(15) not null,
>   role_name     varchar(15) not null, varchar(15) null
>   );
>

If the roles will not be very dynamic and could be hardcoded you might be
able to use the SET datatype which is described here:
http://www.mysql.com/doc/en/SET.html

If you will add/update/change/delete roles often, then you should go for
one of the other methods suggested instead, but if the roles are static,
this might work better for you.
Thread
Multiple RolesCaroline Jen2 Jan
  • Re: Multiple RolesEli Hen2 Jan
  • Re: Multiple RolesMartijn Tonies2 Jan
  • Re: Multiple RolesTobias Asplund2 Jan
  • Re: Multiple RolesEd Leafe2 Jan
  • Re: Multiple RolesRoger Baklund2 Jan