I am trying to build an application similar to a customer-supplier
relationship. I am having a problem figuring out how to model this
relationship to differentiate between the types of users. For example,
people who use my application will include:
Administrators
Managers
Customers
Suppliers
... which are the entries in my Groups table. All users share some
information, such as contact info, which I figured should be stored in
the Users table. However, suppliers have some information that others
do not such as Insurance Provider and Policy Number, and therefore
should not be included in the Users table. My current setup is like
so.
create table groups (
id int not null auto_increment primary key,
name varchar(100) not null unique
);
create table users (
id int not null auto_increment primary key,
group_id int not null,
email varchar(255) not null unique,
password varchar(255) not null
);
create table suppliers (
id int not null auto_increment primary key,
user_id int not null,
ins_provider varchar(255) not null,
policy_number varchar(100) not null
);
This does not seem correct, because it allows all users to be
associated with suppliers. Administrators, for instance, do not have
an ins_provider or policy. This seems like it should be a fairly
simple solution, but I can't seem to figure it out. Please do not just
reference some page in the Cookbook without explanation, because I
have read that about 100 times, and still cannot figure this out.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---