I have this structure table, can I ask is it okay to make my column memberid as foreign key to my user table, even it is already set as unique index ?
Thank you in advance.
CREATE TABLE `mytree` (
`parentid` INT(11) NOT NULL,
`memberid` INT(11) NOT NULL,
`position` CHAR(1) NOT NULL COLLATE 'latin1_swedish_ci',
`amount` DECIMAL(10,2) NOT NULL,
UNIQUE INDEX `idx_1` (`memberid`),
UNIQUE INDEX `idx_2` (`parentid`, `position`)
)
COLLATE='utf8_general_ci'
ENGINE=InnoDB
;