I'm sketching and trial-running a db for keeping track of all my forms of (bidirectional!) communication with my Children {don't ask}....

One "relationship" is causing the SQL scripting to fail. It's generating an error 1005 - shown BELOW. (Temporarily deleting the "join" table corrects this problem: All other tables/joins seem to be fine.) Can you help me [schematic BELOW2]?

Err Msg:


Executing SQL script in server

ERROR: Error 1005: Can't create table 'barrydb.electmediaaccountinfo_has_familymember' (errno: 150)
-- -----------------------------------------------------

-- Table `barryDB`.`electMediaAccountInfo_has_familyMember`

-- -----------------------------------------------------

Code SQL:
CREATE  TABLE IF NOT EXISTS `barryDB`.`electMediaAccountInfo_has_familyMember` (
 
  `electMediaAccountInfo_electMediaAccountInfoID` INT NOT NULL ,
 
  `familyMember_fMemberID` INT NOT NULL ,
 
  PRIMARY KEY (`electMediaAccountInfo_electMediaAccountInfoID`, `familyMember_fMemberID`) ,
 
  INDEX `fk_electMedAccountInfo_has_famillyMember_famillyMember1` (`familyMember_fMemberID` ASC) ,
 
  INDEX `fk_electMedAccountInfo_has_famillyMember_electMedAccountInfo1` (`electMediaAccountInfo_electMediaAccountInfoID` ASC) ,
 
  CONSTRAINT `fk_electMedAccountInfo_has_famillyMember_electMedAccountInfo1`
 
    FOREIGN KEY (`electMediaAccountInfo_electMediaAccountInfoID` )
 
    REFERENCES `barryDB`.`electMediaAccountInfo` (`electMediaAccountInfoID` )
 
    ON DELETE NO ACTION
 
    ON UPDATE NO ACTION,
 
  CONSTRAINT `fk_electMedAccountInfo_has_famillyMember_famillyMember1`
 
    FOREIGN KEY (`familyMember_fMemberID` )
 
    REFERENCES `barryDB`.`familyMember` (`fMemberID` )
 
    ON DELETE NO ACTION
 
    ON UPDATE NO ACTION)

ENGINE = InnoDB

SQL script execution finished: statements: 20 succeeded, 1 failed


db Schematic/Model:

trialCustodyDB_3-15-2012 1-40-02 PM.png

Can you, will you nudge this dufus back on track?

Barry =}