...
- roles is a a table containing one role for every role in the system:
- id is the unique identifier of a role
- role is a human-readable name for a role
If you want to use obfuscated, MD5 hashed or encrypted passwords the 'pwd' column of the 'users' table must be large enough to hold obfuscated, hashed or encrypted password plus the appropriate prefix.
The pseudo-sql to set up each of these tables would look like:
| Code Block | ||
|---|---|---|
| ||
( id integer primary key, username varchar(100) not null unique key, pwd varchar(2050) not null ); |
| Code Block | ||
|---|---|---|
| ||
( user_id integer not null, role_id integer not null, unique key (user_id, role_id), index(user_id) ); |
...