Hi!
I read the book "Agile Web Development With Application Yii1.1 and PHP5" and I do not understand why the author uses two table tbl_project_user_assignment:
CREATE TABLE ‘tbl_project_user_assignment’
(
‘PROJECT_ID’ Int (11) NOT NULL,
‘User_id’ int (11) NOT NULL,
‘Create_time’ DATETIME
‘Create_user_id’ INTEGER,
‘Update_time’ DATETIME
‘Update_user_id’ INTEGER,
PRIMARY KEY (‘PROJECT_ID’, ‘user_id’)
) ENGINE = InnoDB
;
And tbl_project_user_role :
create table tbl_project_user_role
(
PROJECT_ID INTEGER NOT NULL,
user_id INTEGER NOT NULL,
role VARCHAR (64) NOT NULL,
PRIMARY KEY (projectId userId, Role)
foreign key (PROJECT_ID) tbl_project references (id)
foreign key (user_id) references tbl_user (id)
foreign key (role) references AuthItem (name)
);
This produces duplicates in the database.
Could you clarify the above please